Skip to content

Commit

Permalink
Add a new 2024-09-01-preview dataplane API version to the DevCenter (A…
Browse files Browse the repository at this point in the history
…zure#30359)

* add 2024-09-01-preview to main.tsp

* Add force option for environment deletion, add apis for get/list snapshots and restore to snapshot

* update readme

* commit changes  by npx tsv specification/devcenter/DevCenter

* address review feedback (add format info on timestamps, rename to restoreSnapshot, update operation result)

* remove stale example file

* Add parameters file

* change alias to model per PR feedback

* update version in client.tsp

---------

Co-authored-by: Sneha Nagendra <[email protected]>
  • Loading branch information
snehanagendra and snnagen authored Sep 17, 2024
1 parent 69fd9b7 commit f9f493d
Show file tree
Hide file tree
Showing 142 changed files with 12,043 additions and 1,686 deletions.
49 changes: 39 additions & 10 deletions specification/devcenter/DevCenter/DevBox/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ union DevBoxOperationKind {
@doc("The operation represents a Dev Box repair.")
Repair: "Repair",

@doc("The operation represents a Dev Box restore from snapshot.")
@added(APIVersions.v2024_09_01_preview)
RestoreSnapshot: "RestoreSnapshot",

string,
}

Expand Down Expand Up @@ -476,7 +480,7 @@ model ImageReference {
@visibility("read")
osBuildNumber?: string;

@doc("The datetime that the backing image version was published.")
@doc("The datetime that the backing image version was published, in RFC3339 format.")
@visibility("read")
publishedDate?: utcDateTime;
}
Expand Down Expand Up @@ -623,7 +627,7 @@ model DevBox {
@visibility("read")
imageReference?: ImageReference;

@doc("Creation time of this Dev Box.")
@doc("Creation time of this Dev Box, in RFC3339 format.")
@visibility("read")
createdTime?: utcDateTime;

Expand Down Expand Up @@ -675,7 +679,7 @@ model DevBoxAction {
@added(APIVersions.v2024_02_01)
sourceType: DevBoxActionSourceType;

@doc("The earliest time that the action could occur (UTC).")
@doc("The earliest time that the action could occur (UTC), in RFC3339 format.")
suspendedUntil?: utcDateTime;

@doc("Details about the next run of this action.")
Expand All @@ -684,7 +688,7 @@ model DevBoxAction {

@doc("Details about the next run of an action.")
model DevBoxNextAction {
@doc("The time the action will be triggered (UTC).")
@doc("The time the action will be triggered (UTC), in RFC3339 format.")
scheduledTime: utcDateTime;
}

Expand Down Expand Up @@ -735,10 +739,10 @@ model DevBoxOperation {
@doc("The object ID of the actor which initiated the operation.")
createdByObjectId?: Azure.Core.uuid;

@doc("he time the operation started.")
@doc("he time the operation started, in RFC3339 format.")
startTime?: utcDateTime;

@doc("The time the operation finished.")
@doc("The time the operation finished, in RFC3339 format.")
endTime?: utcDateTime;

@doc("Provisioning or operation error details. Populated only for error states.")
Expand Down Expand Up @@ -789,6 +793,16 @@ model DevBoxRepairOperationResult {
message?: string;
}

@doc("Information about a restore from snapshot operation on a Dev Box.")
@added(APIVersions.v2024_09_01_preview)
model DevBoxRestoreSnapshotOperation extends DevBoxOperation {
@doc("Specifies the snapshot id that was used for the restore operation.")
snapshotId: string;

@doc("The kind of operation that occurred.")
kind: DevBoxOperationKind.RestoreSnapshot;
}

@doc("The Customization Task list result.")
model PagedCustomizationTaskDefinition
is Azure.Core.Page<CustomizationTaskDefinition>;
Expand Down Expand Up @@ -879,11 +893,11 @@ model CustomizationTask {
@visibility("read")
status?: CustomizationTaskStatus;

@doc("Start time of the task.")
@doc("Start time of the task, in RFC3339 format.")
@visibility("read")
startTime?: utcDateTime;

@doc("End time of the task.")
@doc("End time of the task, in RFC3339 format.")
@visibility("read")
endTime?: utcDateTime;
}
Expand Down Expand Up @@ -945,11 +959,26 @@ model CustomizationGroup {
@visibility("read")
status?: CustomizationGroupStatus;

@doc("Start time of the customization group.")
@doc("Start time of the customization group, in RFC3339 format.")
@visibility("read")
startTime?: utcDateTime;

@doc("End time of the customization group.")
@doc("End time of the customization group, in RFC3339 format.")
@visibility("read")
endTime?: utcDateTime;
}

@added(APIVersions.v2024_09_01_preview)
@doc("A DevBox snapshot")
@resource("snapshots")
@parentResource(DevBox)
model DevBoxSnapshot {
@key("snapshotId")
@doc("The id of the snapshot. Should be treated as opaque string.")
@visibility("read")
snapshotId: string;

@doc("The datetime that the snapshot was created, in RFC3339 format.")
@visibility("read")
createdTime: utcDateTime;
}
41 changes: 41 additions & 0 deletions specification/devcenter/DevCenter/DevBox/parameters.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import "@typespec/rest";
import "@typespec/http";
import "@azure-tools/typespec-azure-core";
import "../shared/models.tsp";

using TypeSpec.Rest;
using TypeSpec.Http;
using TypeSpec.Versioning;

namespace DevCenterService;

@doc("The snapshot id query parameter.")
model SnapshotIdQueryParameter {
@doc("Required parameter that specifies the snapshot id to use for the restore operation.")
@query
snapshotId: string;
}

@doc("The delay until query parameter.")
model DelayUntilQueryParameter {
@doc("The time to delay the Dev Box action or actions until, in RFC3339 format.")
@query("until")
delayUntil: utcDateTime;
}

@doc("The hibernate query parameter.")
model HibernateQueryParameter {
@doc("Optional parameter to hibernate the dev box.")
@query
hibernate?: boolean;
}

@doc("The Dev Box name path parameter.")
model DevBoxNameParameter {
@doc("The name of a Dev Box.")
@maxLength(63)
@minLength(3)
@pattern("^[a-zA-Z0-9][a-zA-Z0-9-_.]{2,62}$")
@path
devBoxName: string;
}
Loading

0 comments on commit f9f493d

Please sign in to comment.