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