Skip to content

Commit f9fb4b1

Browse files
snehanagendrasnnagenArber HilaArberH
authored
devcenter microsoft.dev center 2024 05 01 preview (#27863)
* Adds base for updating Microsoft.DevCenter from version preview/2023-10-01-preview to version 2024-05-01-preview * Updates readme * Updates API version in new specs and examples * add new changes for 2024-05-01-preview * run prettier and fix * Add directive to supress HostParametersValidation lintdiff errors * fix ntegerTypeMustHaveFormat lintdiff error * add suppression for OperationIdNounVerb * Add new API changes in TypeSpec * Generate the swagger from TypeSpec * fix tag name * Fix package tag for real * Add missing examples to TypeSpec folder * Recompile * Few more fixes * Some more fixes * Fix validateCustomizationTasksAction route to be LRO * Fix issues with examples. Remove a couple of old ones. Add two missing ones * Run linter * Validate Customization group route changes * Fix another example with accept header/param * Update visbility since the name can be used in post actions * Needs to be CREATE visibility per documentation * Rename timeout to timeoutInSeconds * Merge latest with main, fix package-lock issue, run npx tsv devcenter * Update comment as per PR suggestions * Change route * Remove regionality from supporting documents link, use Azure.Core.Foundations.Error object instead of our own * Configure param with query parameter traits * Add a missing space * Fix header, should actually be in response * Fix warnings due to missing doc descriptions * Run linter * use dayton's wording for tasks include parameter * Remove unncessary statusCode in response object * Remove unnecessary @action decorator since the action name is already included in the route --------- Co-authored-by: Sneha Nagendra <[email protected]> Co-authored-by: Arber Hila <[email protected]> Co-authored-by: Arber Hila <[email protected]>
1 parent a542d7d commit f9fb4b1

File tree

126 files changed

+11737
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+11737
-10
lines changed

specification/devcenter/DevCenter/DevBox/models.tsp

Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,78 @@ union ScheduledFrequency {
187187
string,
188188
}
189189

190+
@doc("Type of the parameter.")
191+
@added(APIVersions.v2024_05_01_preview)
192+
union CustomizationTaskDefinitionParameterType {
193+
@doc("The parameter accepts a string value.")
194+
string: "string",
195+
196+
@doc("The parameter accepts a number value.")
197+
number: "number",
198+
199+
@doc("The parameter accepts a boolean value.")
200+
boolean: "boolean",
201+
202+
string,
203+
}
204+
205+
@doc("What account to run the task as.")
206+
@added(APIVersions.v2024_05_01_preview)
207+
union CustomizationTaskExecutionAccount {
208+
@doc("The SYSTEM account.")
209+
System: "System",
210+
211+
@doc("The account of the signed in user.")
212+
User: "User",
213+
214+
string,
215+
}
216+
217+
@doc("Status of a customization task.")
218+
@added(APIVersions.v2024_05_01_preview)
219+
union CustomizationTaskStatus {
220+
@doc("The task has not yet started.")
221+
NotStarted: "NotStarted",
222+
223+
@doc("The task is currently executing.")
224+
Running: "Running",
225+
226+
@doc("The task successfully executed.")
227+
Succeeded: "Succeeded",
228+
229+
@doc("The task reference is not valid.")
230+
FailedValidation: "FailedValidation",
231+
232+
@doc("he task was skipped.")
233+
Skipped: "Skipped",
234+
235+
@doc("The task timed out.")
236+
TimedOut: "TimedOut",
237+
238+
@doc("The task failed to execute.")
239+
Failed: "Failed",
240+
241+
@doc("The task is awaiting the User Account Control (UAC) prompt to be approved. (See more at: https://learn.microsoft.com/windows/security/application-security/application-control/user-account-control/)")
242+
WaitingForUserInputUac: "WaitingForUserInputUac",
243+
244+
@doc("The task is awaiting the user to connect to the Dev Box to execute.")
245+
WaitingForUserSession: "WaitingForUserSession",
246+
247+
string,
248+
}
249+
250+
@doc("Status of validating a list of customization tasks.")
251+
@added(APIVersions.v2024_05_01_preview)
252+
union CustomizationTaskListValidationStatus {
253+
@doc("Validation succeeded.")
254+
Succeeded: "Succeeded",
255+
256+
@doc("Validation failed.")
257+
Failed: "Failed",
258+
259+
string,
260+
}
261+
190262
@doc("The power states of a Dev Box.")
191263
union PowerState {
192264
@doc("The Dev Box power state is not known.")
@@ -207,6 +279,36 @@ union PowerState {
207279
string,
208280
}
209281

282+
@doc("Status of validating a list of customization tasks.")
283+
@added(APIVersions.v2024_05_01_preview)
284+
union ListCustomizationGroupsIncludeProperty {
285+
@doc("Include list of tasks in the response.")
286+
tasks: "tasks",
287+
288+
string,
289+
}
290+
291+
@doc("Status of a customization group.")
292+
@added(APIVersions.v2024_05_01_preview)
293+
union CustomizationGroupStatus {
294+
@doc("The customization group has not yet started.")
295+
NotStarted: "NotStarted",
296+
297+
@doc("The customization group is currently executing.")
298+
Running: "Running",
299+
300+
@doc("All tasks in the customization group successfully executed.")
301+
Succeeded: "Succeeded",
302+
303+
@doc("At least one task in the customization group failed.")
304+
Failed: "Failed",
305+
306+
@doc("At least one task in the customization group failed validation.")
307+
ValidationFailed: "ValidationFailed",
308+
309+
string,
310+
}
311+
210312
@doc("The type of action which will take place on a Dev Box.")
211313
union DevBoxActionType {
212314
@doc("The action will stop the Dev Box.")
@@ -537,6 +639,10 @@ model RemoteConnection {
537639

538640
@doc("Link to open a Remote Desktop session.")
539641
rdpConnectionUrl?: url;
642+
643+
@added(APIVersions.v2024_05_01_preview)
644+
@doc("Link to open a remote desktop session via a dev box's underlying Cloud PC (This will default to Windows App).")
645+
cloudPcConnectionUrl?: url;
540646
}
541647

542648
@doc("An action which will take place on a Dev Box.")
@@ -682,3 +788,168 @@ model DevBoxRepairOperationResult {
682788
@doc("The result message associated with the repair operation.")
683789
message?: string;
684790
}
791+
792+
@doc("The Customization Task list result.")
793+
model CustomizationTaskDefinitionResult
794+
is Azure.Core.Page<CustomizationTaskDefinition>;
795+
796+
@doc("Represents a task to be used in customizing a Dev Box.")
797+
@added(APIVersions.v2024_05_01_preview)
798+
@resource("customizationTasks")
799+
@parentResource(Catalog)
800+
model CustomizationTaskDefinition {
801+
@doc("Full name of the task: {catalogName}/{taskName}.")
802+
@key("taskName")
803+
@visibility("read")
804+
name: string;
805+
806+
@doc("Name of the catalog that the task belongs to.")
807+
@visibility("read")
808+
catalogName: string;
809+
810+
@doc("The unique URI of the customization task.")
811+
@visibility("read")
812+
uri?: url;
813+
814+
@doc("Description of the task.")
815+
description?: string;
816+
817+
@doc("Parameters for the task.")
818+
parameters?: Record<CustomizationTaskDefinitionParameter>;
819+
}
820+
821+
@doc("Parameters for a customization task.")
822+
@added(APIVersions.v2024_05_01_preview)
823+
model CustomizationTaskDefinitionParameter {
824+
@doc("Description of the parameter.")
825+
description?: string;
826+
827+
@doc("Type of the parameter.")
828+
type: CustomizationTaskDefinitionParameterType;
829+
830+
@doc("Whether or not the parameter is required.")
831+
@visibility("read")
832+
required?: boolean;
833+
834+
@doc("Default value for the parameter.")
835+
default?: string;
836+
837+
@doc("Allowed values for the parameter.")
838+
allowed?: string[];
839+
}
840+
841+
@doc("Represents a list of tasks to apply to a Dev Box")
842+
@added(APIVersions.v2024_05_01_preview)
843+
model CustomizationTaskList {
844+
@doc("Tasks to apply.")
845+
tasks?: CustomizationTask[];
846+
}
847+
848+
@doc("A customization task to run on a Dev Box.")
849+
@resource("customizationTasks")
850+
@parentResource(Catalog)
851+
@added(APIVersions.v2024_05_01_preview)
852+
model CustomizationTask {
853+
@doc("Name of the task.")
854+
@key("taskName")
855+
@visibility("read", "create")
856+
name: string;
857+
858+
@doc("Parameters for the task.")
859+
parameters?: Record<string>;
860+
861+
@doc("Display name to help differentiate multiple instances of the same task.")
862+
displayName?: string;
863+
864+
@doc("Timeout, in seconds. Overrides any timeout provided on the task definition.")
865+
timeoutInSeconds?: int32;
866+
867+
@doc("What account to run the task as.")
868+
runAs?: CustomizationTaskExecutionAccount;
869+
870+
@doc("ID of the task instance.")
871+
@visibility("read")
872+
id?: string;
873+
874+
@doc("The unique URI for retrieving the task logs.")
875+
@visibility("read")
876+
logUri?: string;
877+
878+
@doc("Status of the task.")
879+
@visibility("read")
880+
status?: CustomizationTaskStatus;
881+
882+
@doc("Start time of the task.")
883+
@visibility("read")
884+
startTime?: utcDateTime;
885+
886+
@doc("End time of the task.")
887+
@visibility("read")
888+
endTime?: utcDateTime;
889+
}
890+
891+
@doc("The operation result of validating a list of customization tasks.")
892+
@added(APIVersions.v2024_05_01_preview)
893+
model CustomizationTaskListValidationOperationResult {
894+
...OperationStatus;
895+
896+
@doc("Outcome of validation.")
897+
result?: CustomizationTaskListValidationResult;
898+
}
899+
900+
@doc("The result of validating a list of customization tasks.")
901+
@added(APIVersions.v2024_05_01_preview)
902+
model CustomizationTaskListValidationResult {
903+
@doc("Outcome of validation.")
904+
validationResult: CustomizationTaskListValidationStatus;
905+
906+
@doc("List of validation errors. Absent if no errors.")
907+
errors?: CustomizationTaskListValidationError[];
908+
}
909+
910+
@doc("All of the validation errors for a customization task.")
911+
@added(APIVersions.v2024_05_01_preview)
912+
model CustomizationTaskListValidationError {
913+
@doc("The customization task that the error is about.")
914+
target: CustomizationTask;
915+
916+
@doc("List of validation errors for the task.")
917+
details: Azure.Core.Foundations.Error[];
918+
}
919+
920+
@doc("Represents a list of tasks to apply to a Dev Box.")
921+
@resource("customizationGroups")
922+
@parentResource(DevBox)
923+
@added(APIVersions.v2024_05_01_preview)
924+
model CustomizationGroup {
925+
@doc("""
926+
Tasks to apply. Note by default tasks are excluded from the response when
927+
listing customization groups. To include them, use the `include=tasks` query
928+
parameter.
929+
""")
930+
tasks?: CustomizationTask[];
931+
932+
@doc("The unique URI of the customization group.")
933+
@visibility("read")
934+
uri?: string;
935+
936+
@doc("Name of the customization group.")
937+
@key("customizationGroupName")
938+
@minLength(3)
939+
@maxLength(63)
940+
@pattern("^[a-zA-Z0-9][a-zA-Z0-9-_.]{2,62}$")
941+
@visibility("read")
942+
name: string;
943+
944+
@doc("Status of the customization group.")
945+
@visibility("read")
946+
status?: CustomizationGroupStatus;
947+
948+
@doc("Start time of the customization group.")
949+
@visibility("read")
950+
startTime?: utcDateTime;
951+
952+
@doc("End time of the customization group.")
953+
@visibility("read")
954+
endTime?: utcDateTime;
955+
}

0 commit comments

Comments
 (0)