Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
cc9a2c6
initial tsp conversion
catalinaperalta Sep 20, 2023
015cd91
move main and tspconfig
catalinaperalta Sep 20, 2023
3cb7f22
add client.tsp
catalinaperalta Sep 20, 2023
d0fa7ed
fix shared models
catalinaperalta Sep 20, 2023
a89a564
prep for versioning
catalinaperalta Sep 20, 2023
91e3c2f
define clients in client.tsp
catalinaperalta Sep 20, 2023
cd93591
add auth
catalinaperalta Sep 20, 2023
a40397c
fix conflicts
catalinaperalta Sep 20, 2023
dd15a31
add files for autorest emitter
catalinaperalta Sep 20, 2023
bbcf343
add resources and standard ops
catalinaperalta Sep 21, 2023
0f4d467
add versioning
catalinaperalta Sep 21, 2023
e386163
add versioned swaggers
catalinaperalta Sep 21, 2023
1b67df6
update generated swaggers
catalinaperalta Sep 21, 2023
79bdaca
reorganize code
catalinaperalta Sep 26, 2023
34de379
add ts to tspconfig.yaml
catalinaperalta Sep 26, 2023
200a430
update config
catalinaperalta Sep 26, 2023
c29e1db
update routes for accuracy
catalinaperalta Sep 28, 2023
25912b1
more route fixes
catalinaperalta Sep 28, 2023
02a2016
remove preview refs
catalinaperalta Sep 28, 2023
d8125b2
remove preview version
catalinaperalta Sep 28, 2023
f6fbdf6
remove extra op
catalinaperalta Sep 28, 2023
39bbc3a
make models more accurate
catalinaperalta Sep 29, 2023
a34e677
fix client.tsp
catalinaperalta Oct 6, 2023
1945287
add python to tspconfig.yaml
catalinaperalta Oct 6, 2023
8e1839b
fix lros
catalinaperalta Oct 6, 2023
f02b1b3
create dev box fix
catalinaperalta Oct 6, 2023
f346112
add final operation for createdevbox
catalinaperalta Oct 7, 2023
4fe0473
update tspconfig.yaml
catalinaperalta Oct 11, 2023
564d655
Update EnvironmentsClient to DeploymentEnvironmentsClient
drielenr Oct 12, 2023
45f2737
Update client order
drielenr Oct 12, 2023
00377b9
Update userId doc
drielenr Oct 12, 2023
d426e5f
Update from GetEnvironmentByUser to GetEnvironment
drielenr Oct 12, 2023
75a584d
Change CreateOrReplaceEnvironment to CreateOrUpdateEnvironment
drielenr Oct 12, 2023
68d595e
Update ListEnvironments
drielenr Oct 12, 2023
0df4d5c
Remove ByProject
drielenr Oct 12, 2023
acd853d
Add Operation Status
drielenr Oct 12, 2023
0c0d7f0
Rename Dev Boxes Client methods
drielenr Oct 13, 2023
95cfc0a
Add @pollingOperation for LRO
drielenr Oct 13, 2023
6646098
change order
drielenr Oct 13, 2023
3c16afe
optinal properties for filter and maxCount
drielenr Oct 13, 2023
62277bf
Update GetSchedules parameter order and make then nullable
drielenr Oct 13, 2023
4d7987b
Make hibernate nullable
drielenr Oct 13, 2023
2de84cb
Add and update list devboxes operations
drielenr Oct 13, 2023
9c13b41
fix conflict. move get all devboxes from devcenter to devbox client
drielenr Oct 13, 2023
73dfff3
make list all dev boxes filter and top nullable
drielenr Oct 13, 2023
9274cf0
DevCenter client nullablle filter
drielenr Oct 13, 2023
67986ed
rename namespace
catalinaperalta Oct 14, 2023
43bcb69
add client.python.tsp
catalinaperalta Oct 14, 2023
22f37dc
update tspconfig.yaml
catalinaperalta Oct 14, 2023
d2a28c1
Rename python client tsp
drielenr Oct 16, 2023
5f0cd49
Add client parameter description
drielenr Oct 16, 2023
d528bd1
update put lros
catalinaperalta Oct 17, 2023
a962e1c
Merge branch 'driele/tsp' of https://github.com/Azure/azure-rest-api-…
catalinaperalta Oct 17, 2023
1542b0a
switch to foundations error response
catalinaperalta Oct 17, 2023
bf55b37
remove custom error defs
catalinaperalta Oct 17, 2023
064b6c7
remove default value from description
drielenr Oct 17, 2023
f4cc82c
Add java option
drielenr Oct 18, 2023
b8e3abf
update endpoint to devCenterEndpoint
drielenr Oct 18, 2023
b232bc4
more ranaming based on meeting review
drielenr Oct 18, 2023
10d2d39
Make top optional for environments and switching parameter order
drielenr Oct 23, 2023
06804cc
update client prop to delayuntil and request to until to match api re…
drielenr Oct 23, 2023
6c25bc2
try @query("until")
drielenr Oct 24, 2023
9d7a4d7
Revert "update endpoint to devCenterEndpoint"
drielenr Oct 26, 2023
74e93fc
Move all operation to one client
drielenr Oct 30, 2023
514dbda
Update js tspconfig
drielenr Nov 15, 2023
f0763d5
add generate metadada
drielenr Nov 15, 2023
0f20662
add convenience method generation
drielenr Nov 22, 2023
25738a2
Add models for python
drielenr Nov 27, 2023
fb2bc14
Add description and rename short name models for csharp
drielenr Nov 27, 2023
51c1194
Update documentation in remaining enums
drielenr Nov 28, 2023
8442c08
Fix error AZC0030 csharp model name can't end with Definition or Para…
drielenr Nov 28, 2023
3cc097e
re-test default userId set to `me`
drielenr Nov 28, 2023
d5d19a9
Renaming and adding enums
drielenr Dec 11, 2023
dde96e8
Merge branch 'main' into feature/devcenter-tsp
drielenr Dec 11, 2023
917a82e
temp remove enum
drielenr Dec 11, 2023
eaea09d
update type to unknown
drielenr Dec 11, 2023
89f4b6a
Revert "temp remove enum"
drielenr Dec 11, 2023
c65868e
update schema type and fix localadim name
drielenr Dec 12, 2023
fc4b3c3
Add resourceIdentifier, uuid and doc for enum
drielenr Dec 13, 2023
c87673a
test without resouceid
drielenr Dec 13, 2023
86ae0c3
remove linter extends arm
drielenr Dec 13, 2023
9a11d0f
wip createdevbox
catalinaperalta Dec 13, 2023
a8904ad
Revert "wip createdevbox"
drielenr Dec 16, 2023
6aa435a
update create dev box to use pool name as body instead of model
drielenr Jan 16, 2024
a73102e
Merge branch 'main' into feature/devcenter-tsp
drielenr Jan 16, 2024
9a08d3e
Update type to serialize using string instead of bytes
drielenr Jan 17, 2024
5562b00
add visibility `create` to local administrator
drielenr Jan 17, 2024
1a6a082
update user to string as it accepts "me"
drielenr Jan 18, 2024
16b8581
remove emit
drielenr Jan 18, 2024
afea630
Fix error casing-style: The names of Operation types must use camelCase
drielenr Jan 18, 2024
b87f596
test use Standard Operations
drielenr Jan 19, 2024
1a5a5e8
Revert "test use Standard Operations"
drielenr Jan 19, 2024
3120ac4
suppress use-standard-operations
drielenr Jan 19, 2024
acff5b0
camel case for python client
drielenr Jan 19, 2024
577320e
suppress stand ope error in the interface
drielenr Jan 19, 2024
0df982c
Fix camelcase on models - NEED TO CHECK SERIALIZATION
drielenr Jan 19, 2024
8157752
add doc to operation enum
drielenr Jan 19, 2024
b3a3562
update unknow to bytes
drielenr Jan 19, 2024
ef5053e
fix user model
drielenr Jan 19, 2024
284814e
tsp format
drielenr Jan 19, 2024
b050c3b
Revert "Fix camelcase on models - NEED TO CHECK SERIALIZATION"
drielenr Jan 22, 2024
b0bc3d8
add suppress for case-sensitive wire format
drielenr Jan 22, 2024
6891028
fix vcpus casing for .net
drielenr Jan 22, 2024
e4e3b47
Add typespec autorest and generate examples
drielenr Jan 24, 2024
08412a8
move main and examples to DevCenter
drielenr Jan 24, 2024
a256bad
fix examples
drielenr Jan 24, 2024
e609863
turn off convinience api and make access public for create dev box op
drielenr Jan 30, 2024
f4a27ef
add access and usage to dev box model
drielenr Jan 30, 2024
da7669a
re-use existing examples
drielenr Feb 1, 2024
897495a
remove folders
drielenr Feb 1, 2024
e5335b6
update structure to generate one swagger for each operation group
drielenr Feb 2, 2024
97976f0
Update folder name in the import
drielenr Feb 2, 2024
aa20ae6
revert changes from 09-01-preview
drielenr Feb 2, 2024
3533bd3
try stand op devcenter
drielenr Feb 2, 2024
dd84a97
try stand op devbox
drielenr Feb 2, 2024
b8378d0
revert list devbox stand op
drielenr Feb 2, 2024
21eb3bc
update devbox swagger
drielenr Feb 2, 2024
71745d1
remove filter and top from dev box
drielenr Feb 2, 2024
d5334f1
fix up dev box swagger
drielenr Feb 2, 2024
926c826
fix up devcenter stand op
drielenr Feb 2, 2024
1670c7b
update devcenter swagger
drielenr Feb 2, 2024
2a8eba1
try stand op for environments
drielenr Feb 2, 2024
893c254
remove top query from environments
drielenr Feb 2, 2024
a90a84e
fix up environment stand op
drielenr Feb 2, 2024
637500e
regen environments swagger
drielenr Feb 2, 2024
09a1a1b
devcenter swagger
drielenr Feb 2, 2024
7d82b26
remove filter and top
drielenr Feb 2, 2024
abda463
make power state optional
drielenr Feb 2, 2024
79d4ae1
Fix some model validation errors
drielenr Feb 3, 2024
83a7b27
move access ang usage to client.tsp
drielenr Feb 15, 2024
cd7f2af
update enum to union
drielenr Feb 15, 2024
ad9953c
Merge branch 'main' into feature/devcenter-tsp
drielenr Feb 15, 2024
f43567a
move from projectedName in model to clientName in client
drielenr Feb 16, 2024
ae05177
move suppress to the operation that is being suppressed
drielenr Feb 16, 2024
734e165
rename to DevBoxActionDelayStatus for all languages
drielenr Feb 16, 2024
15b8a05
consistency between nasmespace names
drielenr Feb 16, 2024
344d267
rename python namespace and move it to before the client
drielenr Feb 16, 2024
bc2264b
move example to client.tsp
drielenr Feb 16, 2024
4067cf2
comment autorest
drielenr Feb 16, 2024
9a3114d
use projectedName as clientName is not renaming for csharp
drielenr Feb 16, 2024
d81821e
be more specific with suppress message
drielenr Feb 17, 2024
a13fcda
Revert "update enum to union"
drielenr Feb 20, 2024
faa734c
tsp format
drielenr Feb 20, 2024
b4cb1bd
re-add suppress in client.tsp
drielenr Feb 20, 2024
68981f4
remove client.tsp import from devbox model
drielenr Feb 20, 2024
a8ff332
try example in client
drielenr Feb 20, 2024
9c1eadc
move example back to shared as csharp emitter does not understdand au…
drielenr Feb 20, 2024
571e752
swagger updates
drielenr Feb 20, 2024
e680cac
delete example as csharp emitter doens't understand autorest import
drielenr Feb 21, 2024
50140f3
fix wrong projected name and remaining union
drielenr Feb 21, 2024
e7c90a1
fix XMS_EXAMPLE_NOTFOUND_ERROR
drielenr Feb 21, 2024
f2beac0
revert stand op for create dev box since it generates wrong swagger
drielenr Feb 21, 2024
fdb8acc
update environment paramater type
drielenr Feb 21, 2024
c8f5d13
update parameterSchema type
drielenr Feb 22, 2024
2bcdfe0
Rename interface so we mantain the same operationId in the generated …
drielenr Feb 22, 2024
f73cb33
add lenght limits and pattern
drielenr Feb 23, 2024
b44e62b
try unkown type for EnvironmentUpdateProperties
drielenr Feb 23, 2024
2f41b06
update operation status type
drielenr Feb 23, 2024
8cfcc8d
stand op action
drielenr Feb 26, 2024
18b344d
swagger stand op action
drielenr Feb 26, 2024
04d0485
move ramaining projectedName to client
drielenr Feb 26, 2024
7a49068
stand op for operation status
drielenr Feb 26, 2024
599b753
use {} instead of Record<unknown>
drielenr Feb 27, 2024
da405d0
Revert "use {} instead of Record<unknown>"
drielenr Feb 27, 2024
fd5aa13
add csharp package dir and clean up tspconfig
drielenr Feb 27, 2024
0817dfd
try fix lint diff rule
drielenr Feb 28, 2024
3eaf91f
move to one swagger
drielenr Feb 28, 2024
16201c7
rename operationIds
drielenr Feb 29, 2024
2a0211f
retrigger checks
drielenr Feb 29, 2024
c27c4d3
retrigger checks after .net PR
drielenr Feb 29, 2024
a4a6fd8
Fixing PR comments
drielenr Mar 5, 2024
b8f55f8
Revert parametersSchema type
drielenr Mar 5, 2024
2a49d46
Updates for python client
drielenr Mar 6, 2024
51007f5
Disable covenient api for csharp only
drielenr Mar 6, 2024
d116696
Update projected names
drielenr Mar 7, 2024
f40ed70
update package version ts
drielenr Mar 7, 2024
ed9af7e
npx tsp format
drielenr Mar 7, 2024
75ebb12
Add java config
drielenr Mar 14, 2024
ebe53c0
Merge branch 'main' into feature/devcenter-tsp
drielenr Mar 14, 2024
ac0495b
Add unique types
drielenr Mar 14, 2024
d5499e4
Use azure location type
drielenr Mar 14, 2024
3401802
Update parametersSchema type
drielenr Mar 14, 2024
5e1fc4f
Add azure flavor
drielenr Mar 14, 2024
b8c720a
Reapply "update enum to union"
drielenr Mar 14, 2024
c99e953
tsp format
drielenr Mar 15, 2024
e0c1e29
Update swagger
drielenr Mar 15, 2024
407e740
tsp format
drielenr Mar 15, 2024
b14f2d7
Remove uniqueItems
drielenr Mar 15, 2024
3d60a4c
remove json schema import
drielenr Mar 15, 2024
20240e3
Turn off convinience API for create environment
drielenr Mar 16, 2024
caa614f
Clean up
drielenr Mar 16, 2024
4620555
Fix DevBoxActionDelayResult
drielenr Mar 18, 2024
1a268b7
Merge branch 'main' into feature/devcenter-tsp
drielenr Mar 18, 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
474 changes: 474 additions & 0 deletions specification/devcenter/DevCenter/DevBox/models.tsp

Large diffs are not rendered by default.

261 changes: 261 additions & 0 deletions specification/devcenter/DevCenter/DevBox/routes.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
import "@azure-tools/typespec-azure-core";
import "@typespec/rest";
import "./models.tsp";
import "../shared/routes.tsp";

using Azure.Core;
using TypeSpec.Rest;
using TypeSpec.Http;

namespace DevCenterService;

interface DevBoxesOperations {
@doc("Lists available pools")
listPools is StandardResourceOperations.ResourceList<Pool>;

@doc("Gets a pool")
getPool is StandardResourceOperations.ResourceRead<Pool>;

@doc("Lists available schedules for a pool.")
listSchedules is StandardResourceOperations.ResourceList<Schedule>;

@doc("Gets a schedule.")
getSchedule is StandardResourceOperations.ResourceRead<Schedule>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need of reuse DevBoxListResult"
// This does fit in the ResourceList<DevBox> but since there are three different operations that returns dev box list result,
// we can't use the standard operation here - it would not allow the use of DevBoxListResult in the other operations.
// error when using it in other operations: duplicate-type-name 'PagedDevBox' (model DevBoxListResult)
@doc("Lists Dev Boxes in the project for a particular user.")
@route("/projects/{projectName}/users/{userId}/devboxes")
@get
listDevBoxes is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute operations.")
@path
projectName: string;

@doc("The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.")
@path
userId: string;
},
DevBoxListResult
>;

@doc("Gets a Dev Box")
getDevBox is StandardResourceOperations.ResourceRead<DevBox>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Standard operations produce wrong swagger"
// The standard operation names the body as resource, so the generated swagger has parameter
// {
// "name": "resource",
// "in": "body",
// },
// instead of the desired
// {
// "name": "body",
// "in": "body",
// }
@doc("Creates or replaces a Dev Box.")
@finalOperation(DevBoxesOperations.getDevBox)
@pollingOperation(SharedOperations.getProjectOperationStatus)
@route("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}")
@put
createDevBox is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute the operation.")
@path
projectName: string;

@doc("The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.")
@path
userId: string;

@doc("The name of a Dev Box.")
@path
devBoxName: string;

@doc("Represents the body request of a Dev Box creation. Dev Box Pool name is required. Optionally set the owner of the Dev Box as local administrator")
@body
body: DevBox;
},
DevBox | {
@statusCode statusCode: 201;

@header("Location")
location: ResourceLocation<DevBox>;

@pollingLocation
@header("Operation-Location")
operationLocation: string;

@body body?: DevBox;
}
>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Does not fit any standard operation pattern"
//Can not use LongRunningResourceDelete because response is 202 or error, but we also accept 204 response"
@doc("Deletes a Dev Box.")
@pollingOperation(SharedOperations.getProjectOperationStatus)
@route("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}")
@delete
deleteDevBox is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute operations.")
@path
projectName: string;

@doc("The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.")
@path
userId: string;

@doc("The name of a Dev Box.")
@path
devBoxName: string;
},
{
@statusCode statusCode: 202;

@header("Location")
location: string;

@pollingLocation
@header("Operation-Location")
operationLocation: string;

@body body: OperationStatus;
} | {
@statusCode statusCode: 204;
}
>;

@doc("Starts a Dev Box")
@pollingOperation(SharedOperations.getProjectOperationStatus)
@action("start")
startDevBox is StandardResourceOperations.LongRunningResourceAction<
DevBox,
{},
{
@statusCode
statusCode: 202;

@body
body: OperationStatus;
}
>;

@doc("Stops a Dev Box")
@pollingOperation(SharedOperations.getProjectOperationStatus)
@action("stop")
stopDevBox is StandardResourceOperations.LongRunningResourceAction<
DevBox,
{
@doc("Optional parameter to hibernate the dev box.")
@query
hibernate?: boolean;
},
{
@statusCode
statusCode: 202;

@body
body: OperationStatus;
}
>;

@doc("Restarts a Dev Box")
@pollingOperation(SharedOperations.getProjectOperationStatus)
@action("restart")
restartDevBox is StandardResourceOperations.LongRunningResourceAction<
DevBox,
{},
{
@statusCode
statusCode: 202;

@body
body: OperationStatus;
}
>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "can not be represeted by using stand operations"
//There is no @key for RemoteConnection model
@doc("Gets RDP Connection info")
@route("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}/remoteConnection")
@get
getRemoteConnection is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute operations.")
@path
projectName: string;

@doc("The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.")
@path
userId: string;

@doc("The name of a Dev Box.")
@path
devBoxName: string;
},
RemoteConnection
>;

@doc("Lists actions on a Dev Box.")
listDevBoxActions is StandardResourceOperations.ResourceList<DevBoxAction>;

@doc("Gets an action.")
getDevBoxAction is StandardResourceOperations.ResourceRead<DevBoxAction>;

@doc("Skips an occurrence of an action.")
@action("skip")
skipAction is StandardResourceOperations.ResourceAction<
DevBoxAction,
{},
NoContentResponse
>;

@doc("Delays the occurrence of an action.")
@action("delay")
delayAction is StandardResourceOperations.ResourceAction<
DevBoxAction,
{
@doc("The time to delay the Dev Box action or actions until.")
@query("until")
delayUntil: utcDateTime;
},
DevBoxAction
>;

@doc("Delays all actions.")
@action("delay")
delayAllActions is StandardResourceOperations.ResourceCollectionAction<
DevBoxAction,
{
@doc("The time to delay the Dev Box action or actions until.")
@query("until")
delayUntil: utcDateTime;
},
DevBoxActionsDelayMultipleResult
>;
}

interface DevBoxesDevCenter {
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Does not fit any standard operation pattern since DevBox has a different path"
@doc("Lists Dev Boxes that the caller has access to in the DevCenter.")
@route("/devboxes")
@get
listAllDevBoxes is Azure.Core.Foundations.Operation<{}, DevBoxListResult>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Does not fit any standard operation pattern since DevBox has a different path"
@doc("Lists Dev Boxes in the Dev Center for a particular user.")
@route("/users/{userId}/devboxes")
@get
listAllDevBoxesByUser is Azure.Core.Foundations.Operation<
{
@doc("The AAD object id of the user. If value is 'me', the identity is taken from the authentication context.")
@path
userId: string;
},
DevBoxListResult
>;
}
17 changes: 17 additions & 0 deletions specification/devcenter/DevCenter/DevCenter/routes.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import "@azure-tools/typespec-azure-core";
import "@typespec/rest";
import "../shared/models.tsp";

using Azure.Core;
using TypeSpec.Rest;
using TypeSpec.Http;

namespace DevCenterService;

interface DevCenterOperations {
@doc("Lists all projects.")
listProjects is StandardResourceOperations.ResourceList<Project>;

@doc("Gets a project.")
getProject is StandardResourceOperations.ResourceRead<Project>;
}
Loading