Skip to content
Merged
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
0466f48
Add SessionPools.json and Sessions.json
yitaopan Mar 4, 2024
085975f
Prettier
yitaopan Mar 4, 2024
736b434
Update Sessions Api, move count from query parameter to body
Mar 15, 2024
7d24da4
Update Sessions Api, create a specific type for updateEnvVars
yitaopan Mar 15, 2024
3f65002
Merge, resolve conflicts
yitaopan Mar 15, 2024
49b2258
Prettier
yitaopan Mar 15, 2024
7579115
Fix
yitaopan Mar 15, 2024
fdf1732
Fix
yitaopan Mar 15, 2024
e2083fc
Test
yitaopan Mar 15, 2024
2105658
Test
yitaopan Mar 15, 2024
b805a40
Test
yitaopan Mar 15, 2024
b89435e
Fix
yitaopan Mar 15, 2024
7b12678
Fix
yitaopan Mar 15, 2024
3012e70
Fix
yitaopan Mar 15, 2024
bc39d7f
Fix
yitaopan Mar 15, 2024
b7e8cde
Add minWarmPoolSize and update coolDownPeriod
yitaopan Mar 21, 2024
0b7b3df
Fix - add minwarmpoolsize for patch
yitaopan Mar 21, 2024
2ef5f2f
Remove MinWarmPoolSize and add ScaleConfiguration
yitaopan Mar 25, 2024
55ca190
sessionpool to sessionPool
yitaopan Mar 25, 2024
be67ed6
Move maxConcurrentSessions into scaleConfiguration
yitaopan Mar 26, 2024
1bd2c71
Update coolDownPeriod to cooldownPeriodInSeconds
yitaopan Mar 26, 2024
64db91e
Merge branch 'release-app-Microsoft.App-2024-02-02-preview' into 2024…
yitaopan Mar 26, 2024
099c7a5
Update example sessionPoolName
yitaopan Mar 26, 2024
c5cf899
Fix Sessions UpdateEnvVar example
yitaopan Mar 26, 2024
faee932
Fix SessionPool example resources
yitaopan Mar 26, 2024
096e9ee
Merge branch 'release-app-Microsoft.App-2024-02-02-preview' into 2024…
yitaopan Mar 28, 2024
406a733
Remove update session env var api
yitaopan Apr 9, 2024
6d0e7a2
Refactor Session apis
yitaopan Apr 9, 2024
d41a1a7
Fix
yitaopan Apr 9, 2024
ab78cdf
Fix
yitaopan Apr 9, 2024
0f21f79
Fix
yitaopan Apr 9, 2024
c167226
Fix
yitaopan Apr 9, 2024
2695e42
Update to customContainerTemplate
yitaopan Apr 16, 2024
a29baf6
Add RunningState and RunningStateDetails for SessionPool
yitaopan Apr 18, 2024
8004066
Make RunningState string
yitaopan Apr 18, 2024
7cb646f
Add enableEgress to sessionPool
yitaopan Apr 18, 2024
bdd6ba5
Remove SessionAuthConfiguration from sessions to sessionPools
yitaopan Apr 18, 2024
ea32d53
Fix and add node count for session pool
yitaopan Apr 18, 2024
5dcfa90
Fix patch
yitaopan Apr 18, 2024
56a1991
Fix typo
yitaopan Apr 18, 2024
5484024
Fix typo
yitaopan Apr 18, 2024
4b8414b
Merge branch 'release-app-Microsoft.App-2024-02-02-preview' into 2024…
yitaopan Apr 18, 2024
d6fa624
Update to v5 commontypes
yitaopan Apr 19, 2024
1bdf67a
Add array identifiers
yitaopan Apr 19, 2024
7c19ebf
Fix more descriptions
yitaopan Apr 19, 2024
0bdc104
Modify generate sessions operationId
yitaopan Apr 19, 2024
548769b
Modify generate sessions operationId
yitaopan Apr 19, 2024
e2a629c
Modify generate sessions operationId
yitaopan Apr 20, 2024
1fb6264
Add suppression
yitaopan Apr 20, 2024
62ea325
Remove Sessions connectionString
yitaopan Apr 23, 2024
5e9f510
Update operation id for generate sessions
yitaopan Apr 23, 2024
1e7acb5
Add SessionPoolNameParameter in commondefinitions
yitaopan Apr 23, 2024
8987ec1
generatedat and expiredat
yitaopan Apr 23, 2024
b84d8a4
sessionKind to sessionType
yitaopan Apr 23, 2024
3af4938
Remove runningState and runningStateDetails for SessionPool
yitaopan Apr 23, 2024
e81d3dc
Fix readonly
yitaopan Apr 23, 2024
da899e6
Fix
yitaopan Apr 23, 2024
b6c3f6c
Fix
yitaopan Apr 23, 2024
19a6af4
Fix
yitaopan Apr 23, 2024
65ec394
Test
yitaopan Apr 23, 2024
bba433a
Remove two supressions
yitaopan Apr 23, 2024
6fd9185
Change boolean to enum
yitaopan Apr 23, 2024
0239396
Fix examples
yitaopan Apr 23, 2024
4403da0
Fix examples
yitaopan Apr 24, 2024
4606920
Temp remove suppression
yitaopan Apr 24, 2024
7b421dc
Fix SessionPools ContainerType
yitaopan Apr 24, 2024
0b6c205
Remove SessionAuthConfiguration
yitaopan Apr 26, 2024
0b42504
Add Suppression back
yitaopan Apr 26, 2024
c705b1c
Fix
yitaopan Apr 26, 2024
edc90bd
Fix
yitaopan Apr 26, 2024
d7d7337
Add constraint to count of generated sessions
yitaopan Apr 26, 2024
372e946
Make Session generation async
yitaopan Apr 26, 2024
052aa40
Fix
yitaopan Apr 26, 2024
c82b9d9
Fix
yitaopan Apr 26, 2024
e008a08
Fix
yitaopan Apr 26, 2024
69a251d
Fix
yitaopan Apr 26, 2024
eeea358
Remove pagable
yitaopan Apr 26, 2024
489cd79
Post to Put
yitaopan Apr 26, 2024
b61b6c5
post
yitaopan Apr 26, 2024
caff56a
post
yitaopan Apr 26, 2024
c35507a
long running post
yitaopan Apr 26, 2024
275a1d7
Fix
yitaopan Apr 26, 2024
9b698a8
Suppression:
yitaopan Apr 26, 2024
4ebdeee
Fix
yitaopan Apr 27, 2024
8b179e9
Fix
yitaopan Apr 27, 2024
093a1a0
Fix
yitaopan Apr 27, 2024
261950f
Fix
yitaopan Apr 27, 2024
e5dcea5
Fix
yitaopan Apr 27, 2024
3d18d06
Fix
yitaopan Apr 27, 2024
b02872d
Fix
yitaopan Apr 27, 2024
da8f917
Fix
yitaopan Apr 27, 2024
f5a1cde
Fix
yitaopan Apr 27, 2024
d9eab1d
Fix
yitaopan Apr 27, 2024
c80b5e4
Remove Sessions Apis
yitaopan Apr 30, 2024
5739186
fix
yitaopan Apr 30, 2024
db41f15
fix
yitaopan Apr 30, 2024
b042168
fix
yitaopan Apr 30, 2024
ad074ac
fix
yitaopan Apr 30, 2024
44d624c
fix
yitaopan May 1, 2024
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,387 @@
{
"swagger": "2.0",
"info": {
"title": "ContainerApps API Client",
"version": "2024-02-02-preview"
},
"schemes": [
"https"
],
"host": "management.azure.com",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"description": "Azure Active Directory OAuth2 Flow.",
"flow": "implicit",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"parameters": {
"SessionPoolNameParameter": {
"name": "sessionPoolName",
"in": "path",
"description": "Name of the Session Pool.",
"required": true,
"type": "string",
"pattern": "^[a-z][a-z0-9]*$",
"minLength": 3,
"maxLength": 63
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}/generateSessions": {
"post": {
"tags": [
"ContainerAppsSessionPoolSessions"
],
"summary": "Generate Sessions from a Session Pool.",
"operationId": "ContainerAppsSessionPoolSessionsGeneration_ListGenerated",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operationId can be ContainerAppsSessionPoolSessionsGeneration_GenerateSessions which is same as operation name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, changed to ContainerAppsSessionPoolSessionsGeneration_GenerateSessions

"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/SessionPoolNameParameter"
},
{
"name": "generateSessionsEnvelope",
"in": "body",
"description": "Properties used to generate a session",
"required": true,
"schema": {
"$ref": "#/definitions/GenerateSessionsRequest"
}
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is async operation then status should be 202 https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md

And if it is not an async operation, then it needs to be under <1 sec completion SLA I guess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yitaopan I am assuming server implementation is also as per API spec as previously it was mentioned as sync operation in API spec.

"description": "OK",
"schema": {
"$ref": "#/definitions/SessionCollection"
}
},
"202": {
"description": "Generating SessionPool Sessions.",
"headers": {
"Location": {
"type": "string"
}
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "azure-async-operation"
},
"x-ms-examples": {
"Generate Sessions": {
"$ref": "./examples/Sessions_GenerateSessions.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}/sessions/{name}": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name

sessionName?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated

"get": {
"tags": [
"ContainerAppsSessionPoolSessions"
],
"summary": "Get the properties of a Session.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: summary description can be better. like Get the details of a Session.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

"operationId": "ContainerAppsSessionPoolSessions_Get",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/SessionPoolNameParameter"
},
{
"name": "name",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these parameters are not auto generated, then possible to parameterize to avoid repetition ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a parameter section

"in": "path",
"description": "Name of the Session.",
"required": true,
"type": "string",
"minLength": 3,
"maxLength": 63
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameter like SessionPoolNameParameter ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, previously because this is only used here so I didn't parameterize this, but I agree with you that it would be better to do this, thanks.

{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK.",
"schema": {
"$ref": "#/definitions/Session"
}
},
"default": {
"description": "Common error response.",
"schema": {
"$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse"
}
}
},
"x-ms-examples": {
"Get Session": {
"$ref": "./examples/Sessions_Get.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}/sessions": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete a session API is not needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sessions would be auto deleted.

"get": {
"tags": [
"ContainerAppsSessionPoolSessions"
],
"summary": "Get the Session Pools in a Session Pool.",
"operationId": "ContainerAppsSessionPoolSessions_ListBySessionPool",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/SessionPoolNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/SessionCollection"
}
},
"default": {
"description": "Error response.",
"schema": {
"$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse"
}
}
},
"x-ms-examples": {
"List Sessions by Session Pool": {
"$ref": "./examples/Sessions_ListBySessionPool.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
}
},
"definitions": {
"SSHConfiguration": {
"description": "SSH configuration of the Session.",
"type": "object",
"properties": {
"username": {
"description": "The username.",
"type": "string"
},
"password": {
"description": "The password.",
"type": "string"
},
"authorizedPublicKey": {
"description": "The authorized public key.",
"type": "string"
}
}
},
"CodeExecutionConfiguration": {
"description": "Code execution configuration of the Session.",
"type": "object",
"properties": {
"token": {
"description": "The token used for code execution.",
"type": "string"
},
"environment": {
"description": "The environment used for code execution.",
"type": "string"
}
}
},
"SessionTemplate": {
"description": "Session template.",
"type": "object",
"properties": {
"requestedDurationInSeconds": {
"description": "The requested duration of the Session in seconds.",
"type": "integer",
"format": "int32"
},
"timeElapsedInSeconds": {
"description": "The time elapsed in seconds since the Session was created.",
"type": "integer",
"format": "int32",
"readOnly": true
},
"expiredAt": {
"description": "The time when the Session will expire.",
"type": "string",
"format": "date-time",
"readOnly": true
},
"generatedAt": {
"description": "The time when the Session was generated.",
"type": "string",
"format": "date-time",
"readOnly": true
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention the format/timezone of time in description

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description say it is timestamp but data type is date-time not integer. If is ISO 8601 date format, then mentioned ISO 8601 date time in UTC format.

"sessionType": {
"description": "The type of the Session.",
"enum": [
"SSH",
"CustomImage"
],
"type": "string",
"x-ms-enum": {
"name": "ContainerType",
"modelAsString": true
}
},
"status": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turned into enums from booleans

"description": "The status of the Session.",
"enum": [
"PodScheduled",
"PodReadyToStartContainers",
"ContainersReady",
"Initialized",
"Ready"
],
"type": "string",
"x-ms-enum": {
"name": "SessionStatus",
"modelAsString": true
},
"readOnly": true
},
"sshConfiguration": {
"description": "SSH configuration of the Session.",
"$ref": "#/definitions/SSHConfiguration"
},
"codeExecutionConfiguration": {
"description": "Code execution configuration of the Session.",
"$ref": "#/definitions/CodeExecutionConfiguration"
}
}
},
"Session": {
"description": "Session resource.",
"type": "object",
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"description": "Session resource specific properties.",
"type": "object",
"properties": {
"name": {
"description": "The name of the Session.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you setting any validation constraints on these properties? If yes, then better to include the spec

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this should be returned by the service rather than decided by the users.

"type": "string"
},
"endpoint": {
"description": "The endpoint of the Session.",
"type": "string"
},
"sessionTemplate": {
"description": "The template of the session.",
"$ref": "#/definitions/SessionTemplate"
}
},
"x-ms-client-flatten": true
}
}
},
"GenerateSessionsRequest": {
"description": "Request body to generate sessions.",
"type": "object",
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"description": "Session resource specific properties.",
"type": "object",
"properties": {
"count": {
"description": "The number of Sessions to generate.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any constraint on count ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, constraint is added.

"type": "integer",
"format": "int32",
"maximum": 1000,
"minimum": 1
},
"sessionTemplate": {
"description": "The template of the session.",
"$ref": "#/definitions/SessionTemplate"
}
},
"x-ms-client-flatten": true
}
}
},
"SessionCollection": {
"description": "Session collection ARM resource.",
"required": [
"value"
],
"type": "object",
"properties": {
"value": {
"description": "Collection of resources.",
"type": "array",
"items": {
"$ref": "#/definitions/Session"
}
},
"nextLink": {
"description": "Link to next page of resources.",
"type": "string",
"readOnly": true
}
}
}
}
}
Loading