Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
49 changes: 14 additions & 35 deletions specification/devcenter/DevCenter/DevBox/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ using TypeSpec.Http;

namespace DevCenterService;

interface DevBoxesOperations {
interface DevBoxes {
@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>;
listSchedulesByPool is StandardResourceOperations.ResourceList<Schedule>;

@doc("Gets a schedule.")
getSchedule is StandardResourceOperations.ResourceRead<Schedule>;
getScheduleByPool 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,
Expand All @@ -29,7 +29,7 @@ interface DevBoxesOperations {
@doc("Lists Dev Boxes in the project for a particular user.")
@route("/projects/{projectName}/users/{userId}/devboxes")
@get
listDevBoxes is Azure.Core.Foundations.Operation<
listDevBoxesByUser is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute operations.")
@path
Expand All @@ -43,7 +43,7 @@ interface DevBoxesOperations {
>;

@doc("Gets a Dev Box")
getDevBox is StandardResourceOperations.ResourceRead<DevBox>;
getDevBoxByUser 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
Expand All @@ -57,8 +57,8 @@ interface DevBoxesOperations {
// "in": "body",
// }
@doc("Creates or replaces a Dev Box.")
@finalOperation(DevBoxesOperations.getDevBox)
@pollingOperation(SharedOperations.getProjectOperationStatus)
@finalOperation(DevBoxes.getDevBoxByUser)
@pollingOperation(OperationStatuses.get)
@route("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}")
@put
createDevBox is Azure.Core.Foundations.Operation<
Expand Down Expand Up @@ -96,7 +96,7 @@ interface DevBoxesOperations {
#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)
@pollingOperation(OperationStatuses.get)
@route("/projects/{projectName}/users/{userId}/devboxes/{devBoxName}")
@delete
deleteDevBox is Azure.Core.Foundations.Operation<
Expand Down Expand Up @@ -130,7 +130,7 @@ interface DevBoxesOperations {
>;

@doc("Starts a Dev Box")
@pollingOperation(SharedOperations.getProjectOperationStatus)
@pollingOperation(OperationStatuses.get)
@action("start")
startDevBox is StandardResourceOperations.LongRunningResourceAction<
DevBox,
Expand All @@ -145,7 +145,7 @@ interface DevBoxesOperations {
>;

@doc("Stops a Dev Box")
@pollingOperation(SharedOperations.getProjectOperationStatus)
@pollingOperation(OperationStatuses.get)
@action("stop")
stopDevBox is StandardResourceOperations.LongRunningResourceAction<
DevBox,
Expand All @@ -164,7 +164,7 @@ interface DevBoxesOperations {
>;

@doc("Restarts a Dev Box")
@pollingOperation(SharedOperations.getProjectOperationStatus)
@pollingOperation(OperationStatuses.get)
@action("restart")
restartDevBox is StandardResourceOperations.LongRunningResourceAction<
DevBox,
Expand Down Expand Up @@ -201,10 +201,10 @@ interface DevBoxesOperations {
>;

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

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

@doc("Skips an occurrence of an action.")
@action("skip")
Expand All @@ -228,7 +228,7 @@ interface DevBoxesOperations {

@doc("Delays all actions.")
@action("delay")
delayAllActions is StandardResourceOperations.ResourceCollectionAction<
delayActions is StandardResourceOperations.ResourceCollectionAction<
DevBoxAction,
{
@doc("The time to delay the Dev Box action or actions until.")
Expand All @@ -238,24 +238,3 @@ interface DevBoxesOperations {
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
>;
}
21 changes: 20 additions & 1 deletion specification/devcenter/DevCenter/DevCenter/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,29 @@ using TypeSpec.Http;

namespace DevCenterService;

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

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

#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
>;
}
20 changes: 10 additions & 10 deletions specification/devcenter/DevCenter/Environments/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ using TypeSpec.Http;

namespace DevCenterService;

interface EnvironmentsOperations {
interface Environments {
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Does not fit any standard operation pattern since Environment has a different path"
@doc("Lists the environments for a project.")
@route("/projects/{projectName}/environments")
@get
listAllEnvironments is Azure.Core.Foundations.Operation<
listEnvironments is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute operations.")
@path
Expand All @@ -31,7 +31,7 @@ interface EnvironmentsOperations {
@doc("Lists the environments for a project and user.")
@route("/projects/{projectName}/users/{userId}/environments")
@get
listEnvironments is Azure.Core.Foundations.Operation<
listEnvironmentsByUser is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute operations.")
@path
Expand All @@ -45,16 +45,16 @@ interface EnvironmentsOperations {
>;

@doc("Gets an environment")
getEnvironment is StandardResourceOperations.ResourceRead<Environment>;
getEnvironmentByUser is StandardResourceOperations.ResourceRead<Environment>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Does not fit any standard operation pattern"
//Can not use LongRunningCreateOrReplace because response is 200 or 201, but we only respond with 201"
@doc("Creates or updates an environment.")
@finalOperation(EnvironmentsOperations.getEnvironment)
@pollingOperation(SharedOperations.getProjectOperationStatus)
@finalOperation(Environments.getEnvironmentByUser)
@pollingOperation(OperationStatuses.get)
@route("/projects/{projectName}/users/{userId}/environments/{environmentName}")
@put
createOrUpdateEnvironment is Azure.Core.Foundations.Operation<
createOrReplaceEnvironment is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute operations.")
@path
Expand Down Expand Up @@ -87,7 +87,7 @@ interface EnvironmentsOperations {
#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 an environment and all its associated resources")
@pollingOperation(SharedOperations.getProjectOperationStatus)
@pollingOperation(OperationStatuses.get)
@route("/projects/{projectName}/users/{userId}/environments/{environmentName}")
@delete
deleteEnvironment is Azure.Core.Foundations.Operation<
Expand Down Expand Up @@ -123,7 +123,7 @@ interface EnvironmentsOperations {
>;

@doc("Lists all of the catalogs available for a project.")
listCatalogs is StandardResourceOperations.ResourceList<Catalog>;
listCatalogsByProject is StandardResourceOperations.ResourceList<Catalog>;

@doc("Gets the specified catalog within the project")
getCatalog is StandardResourceOperations.ResourceRead<Catalog>;
Expand All @@ -132,7 +132,7 @@ interface EnvironmentsOperations {
@doc("Lists all environment definitions available for a project.")
@route("/projects/{projectName}/environmentDefinitions")
@get
listEnvironmentDefinitions is Azure.Core.Foundations.Operation<
listEnvironmentDefinitionsByProject is Azure.Core.Foundations.Operation<
{
@doc("The DevCenter Project upon which to execute operations.")
@path
Expand Down
64 changes: 32 additions & 32 deletions specification/devcenter/DevCenter/client.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace SdkCustomizations;
service: DevCenterService,
})
interface DevCenterClientOperations {
listProjects is DevCenterService.DevCenterOperations.listProjects;
getProject is DevCenterService.DevCenterOperations.getProject;
listProjects is DevCenterService.DevCenter.listProjects;
getProject is DevCenterService.DevCenter.getProject;
}

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "detailed suppress description for each operation can be found in routes.tsp"
Expand All @@ -24,26 +24,26 @@ interface DevCenterClientOperations {
service: DevCenterService,
})
interface DevBoxesClientOperations {
listPools is DevCenterService.DevBoxesOperations.listPools;
getPool is DevCenterService.DevBoxesOperations.getPool;
listSchedules is DevCenterService.DevBoxesOperations.listSchedules;
getSchedule is DevCenterService.DevBoxesOperations.getSchedule;
listAllDevBoxes is DevCenterService.DevBoxesDevCenter.listAllDevBoxes;
listAllDevBoxesByUser is DevCenterService.DevBoxesDevCenter.listAllDevBoxesByUser;
listDevBoxes is DevCenterService.DevBoxesOperations.listDevBoxes;
getDevBox is DevCenterService.DevBoxesOperations.getDevBox;
listPools is DevCenterService.DevBoxes.listPools;
getPool is DevCenterService.DevBoxes.getPool;
listSchedules is DevCenterService.DevBoxes.listSchedulesByPool;
getSchedule is DevCenterService.DevBoxes.getScheduleByPool;
listAllDevBoxes is DevCenterService.DevCenter.listAllDevBoxes;
listAllDevBoxesByUser is DevCenterService.DevCenter.listAllDevBoxesByUser;
listDevBoxes is DevCenterService.DevBoxes.listDevBoxesByUser;
getDevBox is DevCenterService.DevBoxes.getDevBoxByUser;
@convenientAPI(false, "csharp") // https://github.com/Azure/azure-rest-api-specs/issues/28083
createDevBox is DevCenterService.DevBoxesOperations.createDevBox;
deleteDevBox is DevCenterService.DevBoxesOperations.deleteDevBox;
startDevBox is DevCenterService.DevBoxesOperations.startDevBox;
stopDevBox is DevCenterService.DevBoxesOperations.stopDevBox;
restartDevBox is DevCenterService.DevBoxesOperations.restartDevBox;
getRemoteConnection is DevCenterService.DevBoxesOperations.getRemoteConnection;
listDevBoxActions is DevCenterService.DevBoxesOperations.listDevBoxActions;
getDevBoxAction is DevCenterService.DevBoxesOperations.getDevBoxAction;
skipAction is DevCenterService.DevBoxesOperations.skipAction;
delayAction is DevCenterService.DevBoxesOperations.delayAction;
delayAllActions is DevCenterService.DevBoxesOperations.delayAllActions;
createDevBox is DevCenterService.DevBoxes.createDevBox;
deleteDevBox is DevCenterService.DevBoxes.deleteDevBox;
startDevBox is DevCenterService.DevBoxes.startDevBox;
stopDevBox is DevCenterService.DevBoxes.stopDevBox;
restartDevBox is DevCenterService.DevBoxes.restartDevBox;
getRemoteConnection is DevCenterService.DevBoxes.getRemoteConnection;
listDevBoxActions is DevCenterService.DevBoxes.listActions;
getDevBoxAction is DevCenterService.DevBoxes.getAction;
skipAction is DevCenterService.DevBoxes.skipAction;
delayAction is DevCenterService.DevBoxes.delayAction;
delayAllActions is DevCenterService.DevBoxes.delayActions;
}

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "detailed suppress description for each operation can be found in routes.tsp"
Expand All @@ -52,18 +52,18 @@ interface DevBoxesClientOperations {
service: DevCenterService,
})
interface EnvironmentClientOperations {
listAllEnvironments is DevCenterService.EnvironmentsOperations.listAllEnvironments;
listEnvironments is DevCenterService.EnvironmentsOperations.listEnvironments;
getEnvironment is DevCenterService.EnvironmentsOperations.getEnvironment;
listAllEnvironments is DevCenterService.Environments.listEnvironments;
listEnvironments is DevCenterService.Environments.listEnvironmentsByUser;
getEnvironment is DevCenterService.Environments.getEnvironmentByUser;
@convenientAPI(false, "csharp") // same issue as described in https://github.com/Azure/azure-rest-api-specs/issues/28083
createOrUpdateEnvironment is DevCenterService.EnvironmentsOperations.createOrUpdateEnvironment;
deleteEnvironment is DevCenterService.EnvironmentsOperations.deleteEnvironment;
listCatalogs is DevCenterService.EnvironmentsOperations.listCatalogs;
getCatalog is DevCenterService.EnvironmentsOperations.getCatalog;
listEnvironmentDefinitions is DevCenterService.EnvironmentsOperations.listEnvironmentDefinitions;
listEnvironmentDefinitionsByCatalog is DevCenterService.EnvironmentsOperations.listEnvironmentDefinitionsByCatalog;
getEnvironmentDefinition is DevCenterService.EnvironmentsOperations.getEnvironmentDefinition;
listEnvironmentTypes is DevCenterService.EnvironmentsOperations.listEnvironmentTypes;
createOrUpdateEnvironment is DevCenterService.Environments.createOrReplaceEnvironment;
deleteEnvironment is DevCenterService.Environments.deleteEnvironment;
listCatalogs is DevCenterService.Environments.listCatalogsByProject;
getCatalog is DevCenterService.Environments.getCatalog;
listEnvironmentDefinitions is DevCenterService.Environments.listEnvironmentDefinitionsByProject;
listEnvironmentDefinitionsByCatalog is DevCenterService.Environments.listEnvironmentDefinitionsByCatalog;
getEnvironmentDefinition is DevCenterService.Environments.getEnvironmentDefinition;
listEnvironmentTypes is DevCenterService.Environments.listEnvironmentTypes;
}

@@usage(DevCenterService.DevBox, Usage.input | Usage.output);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Creates or replaces a Dev Box.",
"operationId": "DevBoxesOperations_CreateDevBox",
"operationId": "DevBoxes_CreateDevBox",
"parameters": {
"api-version": "2023-04-01",
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Delays the occurrence of an action.",
"operationId": "DevBoxesOperations_DelayAction",
"operationId": "DevBoxes_DelayAction",
"parameters": {
"api-version": "2023-04-01",
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Delays all actions.",
"operationId": "DevBoxesOperations_DelayAllActions",
"operationId": "DevBoxes_DelayActions",
"parameters": {
"api-version": "2023-04-01",
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Deletes a Dev Box.",
"operationId": "DevBoxesOperations_DeleteDevBox",
"operationId": "DevBoxes_DeleteDevBox",
"parameters": {
"api-version": "2023-04-01",
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Gets an action.",
"operationId": "DevBoxesOperations_GetDevBoxAction",
"operationId": "DevBoxes_GetAction",
"parameters": {
"api-version": "2023-04-01",
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Gets a Dev Box",
"operationId": "DevBoxesOperations_GetDevBox",
"operationId": "DevBoxes_GetDevBoxByUser",
"parameters": {
"api-version": "2023-04-01",
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Gets a pool",
"operationId": "DevBoxesOperations_GetPool",
"operationId": "DevBoxes_GetPool",
"parameters": {
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
"projectName": "myProject",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Gets RDP Connection info",
"operationId": "DevBoxesOperations_GetRemoteConnection",
"operationId": "DevBoxes_GetRemoteConnection",
"parameters": {
"api-version": "2023-04-01",
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Gets a schedule.",
"operationId": "DevBoxesOperations_GetSchedule",
"operationId": "DevBoxes_GetScheduleByPool",
"parameters": {
"endpoint": "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/",
"projectName": "myProject",
Expand Down
Loading