From edac2d828ff29c1df10e1fdd1fbd1a44acf8d9fb Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Mon, 15 Sep 2025 17:13:11 +0800 Subject: [PATCH 1/7] wip --- .../Microsoft.Edge.Sites.Management/Site.tsp | 76 +++++++++++-------- .../preview/2024-02-01-preview/sites.json | 42 +++++++--- .../preview/2025-03-01-preview/sites.json | 42 +++++++--- .../sites/stable/2025-06-01/sites.json | 42 +++++++--- 4 files changed, 136 insertions(+), 66 deletions(-) diff --git a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp index 300b23fdb743..7f97425b0eea 100644 --- a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp +++ b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp @@ -16,43 +16,59 @@ namespace Microsoft.Edge; @doc("Site as ARM Resource") model Site is ProxyResource { - #suppress "@typespec/http/metadata-ignored" "" - @doc("Name of Site resource") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$") - @path - @key("siteName") - @segment("sites") - @visibility(Lifecycle.Read) - name: string; + ...ResourceNameParameter< + Resource = Site, + KeyName = "siteName", + SegmentName = "sites", + NamePattern = "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" + >; } +alias SiteOps = Azure.ResourceManager.Legacy.LegacyOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + ...ResourceGroupParameter; + ...Azure.ResourceManager.Legacy.Provider; + }, + KeysOf> +>; + @armResourceOperations interface Sites { - get is ArmResourceRead; - createOrUpdate is ArmResourceCreateOrReplaceAsync; - update is ArmCustomPatchSync; - delete is ArmResourceDeleteSync; - listByResourceGroup is ArmResourceListByParent; + get is SiteOps.Read; + createOrUpdate is SiteOps.CreateOrUpdateAsync; + update is SiteOps.CustomPatchSync; + delete is SiteOps.DeleteSync; + listByResourceGroup is SiteOps.List; } -alias SubscriptionParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters; -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "Custom operation on the scope of subscription" +alias SiteBySubscriptionOps = Azure.ResourceManager.Legacy.LegacyOperations< + { + ...ApiVersionParameter; + ...SubscriptionIdParameter; + ...Azure.ResourceManager.Legacy.Provider; + }, + KeysOf> +>; + +@armResourceOperations interface SitesBySubscription { - list is ArmListBySubscription; - get is ArmResourceRead; - createOrUpdate is ArmResourceCreateOrReplaceAsync< - Site, - BaseParameters = SubscriptionParameters - >; - update is ArmCustomPatchSync< - Site, - SiteUpdate, - BaseParameters = SubscriptionParameters - >; - delete is ArmResourceDeleteSync< - Site, - BaseParameters = SubscriptionParameters - >; + list is SiteBySubscriptionOps.List; + get is SiteBySubscriptionOps.Read; + createOrUpdate is SiteBySubscriptionOps.CreateOrUpdateAsync; + update is SiteBySubscriptionOps.CustomPatchSync; + delete is SiteBySubscriptionOps.DeleteSync; } #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "Custom operation on the scope of Tenant" diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json index b0ff1ffbb3f1..39141f159316 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json @@ -41,13 +41,19 @@ "tags": [ { "name": "Sites" + }, + { + "name": "SitesBySubscription" } ], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites": { "get": { "operationId": "SitesBySubscription_List", - "description": "List Site resources by subscription ID", + "tags": [ + "SitesBySubscription" + ], + "description": "List a Site", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -83,6 +89,9 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}": { "get": { "operationId": "SitesBySubscription_Get", + "tags": [ + "SitesBySubscription" + ], "description": "Get a Site", "parameters": [ { @@ -94,7 +103,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -122,6 +131,9 @@ }, "put": { "operationId": "SitesBySubscription_CreateOrUpdate", + "tags": [ + "SitesBySubscription" + ], "description": "Create a Site", "parameters": [ { @@ -133,7 +145,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -191,6 +203,9 @@ }, "patch": { "operationId": "SitesBySubscription_Update", + "tags": [ + "SitesBySubscription" + ], "description": "Update a Site", "parameters": [ { @@ -202,7 +217,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -210,7 +225,7 @@ { "name": "properties", "in": "body", - "description": "The resource properties to be updated.", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -239,6 +254,9 @@ }, "delete": { "operationId": "SitesBySubscription_Delete", + "tags": [ + "SitesBySubscription" + ], "description": "Delete a Site", "parameters": [ { @@ -250,7 +268,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -283,7 +301,7 @@ "tags": [ "Sites" ], - "description": "List Site resources by resource group", + "description": "List a Site", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -339,7 +357,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -384,7 +402,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -459,7 +477,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -467,7 +485,7 @@ { "name": "properties", "in": "body", - "description": "The resource properties to be updated.", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -513,7 +531,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json index 6a993c13c637..7004f8c37c3b 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json @@ -41,6 +41,9 @@ "tags": [ { "name": "Sites" + }, + { + "name": "SitesBySubscription" } ], "paths": { @@ -305,7 +308,10 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites": { "get": { "operationId": "SitesBySubscription_List", - "description": "List Site resources by subscription ID", + "tags": [ + "SitesBySubscription" + ], + "description": "List a Site", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -341,6 +347,9 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}": { "get": { "operationId": "SitesBySubscription_Get", + "tags": [ + "SitesBySubscription" + ], "description": "Get a Site", "parameters": [ { @@ -352,7 +361,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -380,6 +389,9 @@ }, "put": { "operationId": "SitesBySubscription_CreateOrUpdate", + "tags": [ + "SitesBySubscription" + ], "description": "Create a Site", "parameters": [ { @@ -391,7 +403,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -449,6 +461,9 @@ }, "patch": { "operationId": "SitesBySubscription_Update", + "tags": [ + "SitesBySubscription" + ], "description": "Update a Site", "parameters": [ { @@ -460,7 +475,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -468,7 +483,7 @@ { "name": "properties", "in": "body", - "description": "The resource properties to be updated.", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -497,6 +512,9 @@ }, "delete": { "operationId": "SitesBySubscription_Delete", + "tags": [ + "SitesBySubscription" + ], "description": "Delete a Site", "parameters": [ { @@ -508,7 +526,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -541,7 +559,7 @@ "tags": [ "Sites" ], - "description": "List Site resources by resource group", + "description": "List a Site", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -597,7 +615,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -642,7 +660,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -717,7 +735,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -725,7 +743,7 @@ { "name": "properties", "in": "body", - "description": "The resource properties to be updated.", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -771,7 +789,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json index a98711a7bb83..96aa1a2e92b6 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json @@ -41,6 +41,9 @@ "tags": [ { "name": "Sites" + }, + { + "name": "SitesBySubscription" } ], "paths": { @@ -305,7 +308,10 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites": { "get": { "operationId": "SitesBySubscription_List", - "description": "List Site resources by subscription ID", + "tags": [ + "SitesBySubscription" + ], + "description": "List a Site", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" @@ -341,6 +347,9 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}": { "get": { "operationId": "SitesBySubscription_Get", + "tags": [ + "SitesBySubscription" + ], "description": "Get a Site", "parameters": [ { @@ -352,7 +361,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -380,6 +389,9 @@ }, "put": { "operationId": "SitesBySubscription_CreateOrUpdate", + "tags": [ + "SitesBySubscription" + ], "description": "Create a Site", "parameters": [ { @@ -391,7 +403,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -449,6 +461,9 @@ }, "patch": { "operationId": "SitesBySubscription_Update", + "tags": [ + "SitesBySubscription" + ], "description": "Update a Site", "parameters": [ { @@ -460,7 +475,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -468,7 +483,7 @@ { "name": "properties", "in": "body", - "description": "The resource properties to be updated.", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -497,6 +512,9 @@ }, "delete": { "operationId": "SitesBySubscription_Delete", + "tags": [ + "SitesBySubscription" + ], "description": "Delete a Site", "parameters": [ { @@ -508,7 +526,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -541,7 +559,7 @@ "tags": [ "Sites" ], - "description": "List Site resources by resource group", + "description": "List a Site", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" @@ -597,7 +615,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -642,7 +660,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -717,7 +735,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -725,7 +743,7 @@ { "name": "properties", "in": "body", - "description": "The resource properties to be updated.", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -771,7 +789,7 @@ { "name": "siteName", "in": "path", - "description": "Name of Site resource", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" From a2f5d8fc25b329dc4eec8c8f8df857c76be3734c Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Tue, 16 Sep 2025 11:18:19 +0800 Subject: [PATCH 2/7] fix the extension part --- .../Microsoft.Edge.Sites.Management/Site.tsp | 134 +++++------------- .../preview/2024-02-01-preview/sites.json | 20 +-- .../preview/2025-03-01-preview/sites.json | 32 +---- .../sites/stable/2025-06-01/sites.json | 32 +---- 4 files changed, 52 insertions(+), 166 deletions(-) diff --git a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp index 7f97425b0eea..180a19f810f8 100644 --- a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp +++ b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp @@ -9,7 +9,6 @@ import "./main.tsp"; using TypeSpec.Rest; using Azure.ResourceManager; using TypeSpec.Http; -using TypeSpec.OpenAPI; using TypeSpec.Versioning; namespace Microsoft.Edge; @@ -31,12 +30,7 @@ alias SiteOps = Azure.ResourceManager.Legacy.LegacyOperations< ...ResourceGroupParameter; ...Azure.ResourceManager.Legacy.Provider; }, - KeysOf> + KeysOf >; @armResourceOperations @@ -54,16 +48,12 @@ alias SiteBySubscriptionOps = Azure.ResourceManager.Legacy.LegacyOperations< ...SubscriptionIdParameter; ...Azure.ResourceManager.Legacy.Provider; }, - KeysOf> + KeysOf >; -@armResourceOperations +@armResourceOperations(#{ omitTags: true }) interface SitesBySubscription { + /** List Site resources by subscription ID */ list is SiteBySubscriptionOps.List; get is SiteBySubscriptionOps.Read; createOrUpdate is SiteBySubscriptionOps.CreateOrUpdateAsync; @@ -71,105 +61,55 @@ interface SitesBySubscription { delete is SiteBySubscriptionOps.DeleteSync; } -#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "Custom operation on the scope of Tenant" +alias SiteByServiceGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< + { + ...ApiVersionParameter; + + /** the provider namespace */ + @path + @segment("providers") + @key + providerNamespace: "Microsoft.Management"; + + /** + * The name of the service group + */ + @segment("serviceGroups") + @pattern("^[a-zA-Z0-9\\-_().]{1,90}$") + @key + @path + servicegroupName: string; + }, + Extension.ExtensionProviderNamespace, + { + ...Extension.ExtensionProviderNamespace; + ...KeysOf; + } +>; + +@armResourceOperations(#{ omitTags: true }) interface SitesByServiceGroup { - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Custom operation for tenant scope" - @route("/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites") @doc("list Site at SG scope") @added(Versions.v2025_03_01_preview) @list - listByServiceGroup( - ...ApiVersionParameter, + listByServiceGroup is SiteByServiceGroupOps.List; - @path - @doc("The name of the service group") - @pattern("^[a-zA-Z0-9\\-_().]{1,90}$") - servicegroupName: string, - ): ArmResponse> | ErrorResponse; - - @route("/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}") @doc("Get Site at SG scope") @added(Versions.v2025_03_01_preview) - get( - ...ApiVersionParameter, + get is SiteByServiceGroupOps.Read; - @path - @doc("The name of the service group") - @pattern("^[a-zA-Z0-9\\-_().]{1,90}$") - servicegroupName: string, - - @path - @doc("The name of the site") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$") - siteName: string, - ): ArmResponse | ErrorResponse; - - #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "custom PUT call" - @route("/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}") @put @doc("create or update Site at SG scope") @added(Versions.v2025_03_01_preview) - createOrUpdate( - ...ApiVersionParameter, - - @path - @doc("The name of the service group") - @pattern("^[a-zA-Z0-9\\-_().]{1,90}$") - servicegroupName: string, - - @path - @doc("The name of the site") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$") - siteName: string, - - @body - @doc("The properties of the site") - resource: Site, - ): ArmResourceUpdatedResponse | ArmResourceCreatedResponse< - Site, - ArmAsyncOperationHeader & - Azure.Core.Foundations.RetryAfterHeader - > | ErrorResponse; - - #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "custom PATCH call" - @route("/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}") + createOrUpdate is SiteByServiceGroupOps.CreateOrUpdateAsync; + @patch(#{ implicitOptionality: true }) @doc("update Site at SG scope") @added(Versions.v2025_03_01_preview) - update( - ...ApiVersionParameter, + update is SiteByServiceGroupOps.CustomPatchSync; - @path - @doc("The name of the service group") - @pattern("^[a-zA-Z0-9\\-_().]{1,90}$") - servicegroupName: string, - - @path - @doc("The name of the site") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$") - siteName: string, - - @body - @doc("The properties of the site") - properties: SiteUpdate, - ): ArmResponse | ErrorResponse; - - #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "custom DELETE call" - @route("/providers/Microsoft.Management/serviceGroups/{servicegroupName}/providers/Microsoft.Edge/sites/{siteName}") @delete @doc("delete Site at SG scope") @added(Versions.v2025_03_01_preview) - delete( - ...ApiVersionParameter, - - @path - @doc("The name of the service group") - @pattern("^[a-zA-Z0-9\\-_().]{1,90}$") - servicegroupName: string, - - @path - @doc("The name of the site") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$") - siteName: string, - ): ArmDeletedResponse | ArmDeletedNoContentResponse | ErrorResponse; + delete is SiteByServiceGroupOps.DeleteSync; } diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json index 39141f159316..a92a5e5cd524 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json @@ -41,19 +41,13 @@ "tags": [ { "name": "Sites" - }, - { - "name": "SitesBySubscription" } ], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites": { "get": { "operationId": "SitesBySubscription_List", - "tags": [ - "SitesBySubscription" - ], - "description": "List a Site", + "description": "List Site resources by subscription ID", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -89,9 +83,6 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}": { "get": { "operationId": "SitesBySubscription_Get", - "tags": [ - "SitesBySubscription" - ], "description": "Get a Site", "parameters": [ { @@ -131,9 +122,6 @@ }, "put": { "operationId": "SitesBySubscription_CreateOrUpdate", - "tags": [ - "SitesBySubscription" - ], "description": "Create a Site", "parameters": [ { @@ -203,9 +191,6 @@ }, "patch": { "operationId": "SitesBySubscription_Update", - "tags": [ - "SitesBySubscription" - ], "description": "Update a Site", "parameters": [ { @@ -254,9 +239,6 @@ }, "delete": { "operationId": "SitesBySubscription_Delete", - "tags": [ - "SitesBySubscription" - ], "description": "Delete a Site", "parameters": [ { diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json index 7004f8c37c3b..844bb6090bef 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json @@ -41,9 +41,6 @@ "tags": [ { "name": "Sites" - }, - { - "name": "SitesBySubscription" } ], "paths": { @@ -107,7 +104,7 @@ { "name": "siteName", "in": "path", - "description": "The name of the site", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -151,7 +148,7 @@ { "name": "siteName", "in": "path", - "description": "The name of the site", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -159,7 +156,7 @@ { "name": "resource", "in": "body", - "description": "The properties of the site", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/Site" @@ -225,7 +222,7 @@ { "name": "siteName", "in": "path", - "description": "The name of the site", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -233,7 +230,7 @@ { "name": "properties", "in": "body", - "description": "The properties of the site", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -278,7 +275,7 @@ { "name": "siteName", "in": "path", - "description": "The name of the site", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -308,10 +305,7 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites": { "get": { "operationId": "SitesBySubscription_List", - "tags": [ - "SitesBySubscription" - ], - "description": "List a Site", + "description": "List Site resources by subscription ID", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" @@ -347,9 +341,6 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}": { "get": { "operationId": "SitesBySubscription_Get", - "tags": [ - "SitesBySubscription" - ], "description": "Get a Site", "parameters": [ { @@ -389,9 +380,6 @@ }, "put": { "operationId": "SitesBySubscription_CreateOrUpdate", - "tags": [ - "SitesBySubscription" - ], "description": "Create a Site", "parameters": [ { @@ -461,9 +449,6 @@ }, "patch": { "operationId": "SitesBySubscription_Update", - "tags": [ - "SitesBySubscription" - ], "description": "Update a Site", "parameters": [ { @@ -512,9 +497,6 @@ }, "delete": { "operationId": "SitesBySubscription_Delete", - "tags": [ - "SitesBySubscription" - ], "description": "Delete a Site", "parameters": [ { diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json index 96aa1a2e92b6..6ed9bd604a11 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json @@ -41,9 +41,6 @@ "tags": [ { "name": "Sites" - }, - { - "name": "SitesBySubscription" } ], "paths": { @@ -107,7 +104,7 @@ { "name": "siteName", "in": "path", - "description": "The name of the site", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -151,7 +148,7 @@ { "name": "siteName", "in": "path", - "description": "The name of the site", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -159,7 +156,7 @@ { "name": "resource", "in": "body", - "description": "The properties of the site", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/Site" @@ -225,7 +222,7 @@ { "name": "siteName", "in": "path", - "description": "The name of the site", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -233,7 +230,7 @@ { "name": "properties", "in": "body", - "description": "The properties of the site", + "description": "Resource create parameters.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -278,7 +275,7 @@ { "name": "siteName", "in": "path", - "description": "The name of the site", + "description": "The name of the Site", "required": true, "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]{2,22}[a-zA-Z0-9]$" @@ -308,10 +305,7 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites": { "get": { "operationId": "SitesBySubscription_List", - "tags": [ - "SitesBySubscription" - ], - "description": "List a Site", + "description": "List Site resources by subscription ID", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter" @@ -347,9 +341,6 @@ "/subscriptions/{subscriptionId}/providers/Microsoft.Edge/sites/{siteName}": { "get": { "operationId": "SitesBySubscription_Get", - "tags": [ - "SitesBySubscription" - ], "description": "Get a Site", "parameters": [ { @@ -389,9 +380,6 @@ }, "put": { "operationId": "SitesBySubscription_CreateOrUpdate", - "tags": [ - "SitesBySubscription" - ], "description": "Create a Site", "parameters": [ { @@ -461,9 +449,6 @@ }, "patch": { "operationId": "SitesBySubscription_Update", - "tags": [ - "SitesBySubscription" - ], "description": "Update a Site", "parameters": [ { @@ -512,9 +497,6 @@ }, "delete": { "operationId": "SitesBySubscription_Delete", - "tags": [ - "SitesBySubscription" - ], "description": "Delete a Site", "parameters": [ { From 00c1fdef7c7a772ffeb202284a5ca39ab2775054 Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Tue, 16 Sep 2025 11:26:42 +0800 Subject: [PATCH 3/7] format --- specification/edge/Microsoft.Edge.Sites.Management/Site.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp index 180a19f810f8..98957835c924 100644 --- a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp +++ b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp @@ -102,7 +102,7 @@ interface SitesByServiceGroup { @doc("create or update Site at SG scope") @added(Versions.v2025_03_01_preview) createOrUpdate is SiteByServiceGroupOps.CreateOrUpdateAsync; - + @patch(#{ implicitOptionality: true }) @doc("update Site at SG scope") @added(Versions.v2025_03_01_preview) From 14a6e75734366b2e1ba982c1ef28b93f9b402ab1 Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Tue, 16 Sep 2025 15:47:38 +0800 Subject: [PATCH 4/7] refactor typespec --- .../Microsoft.Edge.Sites.Management/Site.tsp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp index 98957835c924..b2fe90d50bda 100644 --- a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp +++ b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp @@ -24,12 +24,7 @@ model Site is ProxyResource { } alias SiteOps = Azure.ResourceManager.Legacy.LegacyOperations< - { - ...ApiVersionParameter; - ...SubscriptionIdParameter; - ...ResourceGroupParameter; - ...Azure.ResourceManager.Legacy.Provider; - }, + ResourceInstanceParameters, KeysOf >; @@ -43,11 +38,7 @@ interface Sites { } alias SiteBySubscriptionOps = Azure.ResourceManager.Legacy.LegacyOperations< - { - ...ApiVersionParameter; - ...SubscriptionIdParameter; - ...Azure.ResourceManager.Legacy.Provider; - }, + ResourceInstanceParameters, KeysOf >; @@ -98,17 +89,15 @@ interface SitesByServiceGroup { @added(Versions.v2025_03_01_preview) get is SiteByServiceGroupOps.Read; - @put @doc("create or update Site at SG scope") @added(Versions.v2025_03_01_preview) createOrUpdate is SiteByServiceGroupOps.CreateOrUpdateAsync; - @patch(#{ implicitOptionality: true }) @doc("update Site at SG scope") @added(Versions.v2025_03_01_preview) + @patch(#{ implicitOptionality: true }) update is SiteByServiceGroupOps.CustomPatchSync; - @delete @doc("delete Site at SG scope") @added(Versions.v2025_03_01_preview) delete is SiteByServiceGroupOps.DeleteSync; From e55ddae4682613dbf5362b71ca61dbe50ec65136 Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Wed, 17 Sep 2025 12:59:51 +0800 Subject: [PATCH 5/7] fix implicitOptionality --- specification/edge/Microsoft.Edge.Sites.Management/Site.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp index b2fe90d50bda..d104131fbdba 100644 --- a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp +++ b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp @@ -95,7 +95,6 @@ interface SitesByServiceGroup { @doc("update Site at SG scope") @added(Versions.v2025_03_01_preview) - @patch(#{ implicitOptionality: true }) update is SiteByServiceGroupOps.CustomPatchSync; @doc("delete Site at SG scope") From 164a743a3a86578a4d4ad1c648fe357dd7eb6198 Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Fri, 19 Sep 2025 14:03:16 +0800 Subject: [PATCH 6/7] update the spec --- .../Microsoft.Edge.Sites.Management/Site.tsp | 83 +++++++------------ .../preview/2024-02-01-preview/sites.json | 8 +- .../preview/2025-03-01-preview/sites.json | 8 +- .../sites/stable/2025-06-01/sites.json | 8 +- 4 files changed, 49 insertions(+), 58 deletions(-) diff --git a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp index d104131fbdba..408a7ffa4c34 100644 --- a/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp +++ b/specification/edge/Microsoft.Edge.Sites.Management/Site.tsp @@ -6,9 +6,7 @@ import "./models.tsp"; import "@typespec/versioning"; import "./main.tsp"; -using TypeSpec.Rest; using Azure.ResourceManager; -using TypeSpec.Http; using TypeSpec.Versioning; namespace Microsoft.Edge; @@ -23,81 +21,62 @@ model Site is ProxyResource { >; } -alias SiteOps = Azure.ResourceManager.Legacy.LegacyOperations< - ResourceInstanceParameters, - KeysOf ->; - @armResourceOperations interface Sites { - get is SiteOps.Read; - createOrUpdate is SiteOps.CreateOrUpdateAsync; - update is SiteOps.CustomPatchSync; - delete is SiteOps.DeleteSync; - listByResourceGroup is SiteOps.List; + get is Extension.Read; + createOrUpdate is Extension.CreateOrUpdateAsync< + Extension.ResourceGroup, + Site + >; + update is Extension.CustomPatchSync< + Extension.ResourceGroup, + Site, + SiteUpdate + >; + delete is Extension.DeleteSync; + /** List a Site */ + listByResourceGroup is Extension.ListByTarget; } -alias SiteBySubscriptionOps = Azure.ResourceManager.Legacy.LegacyOperations< - ResourceInstanceParameters, - KeysOf ->; - @armResourceOperations(#{ omitTags: true }) interface SitesBySubscription { /** List Site resources by subscription ID */ - list is SiteBySubscriptionOps.List; - get is SiteBySubscriptionOps.Read; - createOrUpdate is SiteBySubscriptionOps.CreateOrUpdateAsync; - update is SiteBySubscriptionOps.CustomPatchSync; - delete is SiteBySubscriptionOps.DeleteSync; + list is Extension.ListByTarget; + get is Extension.Read; + createOrUpdate is Extension.CreateOrUpdateAsync; + update is Extension.CustomPatchSync; + delete is Extension.DeleteSync; } -alias SiteByServiceGroupOps = Azure.ResourceManager.Legacy.ExtensionOperations< - { - ...ApiVersionParameter; - - /** the provider namespace */ - @path - @segment("providers") - @key - providerNamespace: "Microsoft.Management"; - - /** - * The name of the service group - */ - @segment("serviceGroups") - @pattern("^[a-zA-Z0-9\\-_().]{1,90}$") - @key - @path - servicegroupName: string; - }, - Extension.ExtensionProviderNamespace, - { - ...Extension.ExtensionProviderNamespace; - ...KeysOf; - } ->; +/** A service group */ +@tenantResource +model ServiceGroup + is Extension.ExternalResource< + "Microsoft.Management", + "serviceGroups", + "servicegroupName" + >; @armResourceOperations(#{ omitTags: true }) interface SitesByServiceGroup { @doc("list Site at SG scope") @added(Versions.v2025_03_01_preview) @list - listByServiceGroup is SiteByServiceGroupOps.List; + listByServiceGroup is Extension.ListByTarget; @doc("Get Site at SG scope") @added(Versions.v2025_03_01_preview) - get is SiteByServiceGroupOps.Read; + get is Extension.Read; @doc("create or update Site at SG scope") @added(Versions.v2025_03_01_preview) - createOrUpdate is SiteByServiceGroupOps.CreateOrUpdateAsync; + createOrUpdate is Extension.CreateOrUpdateAsync; @doc("update Site at SG scope") @added(Versions.v2025_03_01_preview) - update is SiteByServiceGroupOps.CustomPatchSync; + update is Extension.CustomPatchSync; @doc("delete Site at SG scope") @added(Versions.v2025_03_01_preview) - delete is SiteByServiceGroupOps.DeleteSync; + delete is Extension.DeleteSync; } diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json index a92a5e5cd524..bac978b1b17f 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2024-02-01-preview/sites.json @@ -210,7 +210,7 @@ { "name": "properties", "in": "body", - "description": "Resource create parameters.", + "description": "The resource properties to be updated.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -467,7 +467,7 @@ { "name": "properties", "in": "body", - "description": "Resource create parameters.", + "description": "The resource properties to be updated.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -597,6 +597,10 @@ }, "readOnly": true }, + "ServiceGroup": { + "type": "object", + "description": "" + }, "Site": { "type": "object", "description": "Site as ARM Resource", diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json index 844bb6090bef..02fcd3b44f12 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/preview/2025-03-01-preview/sites.json @@ -468,7 +468,7 @@ { "name": "properties", "in": "body", - "description": "Resource create parameters.", + "description": "The resource properties to be updated.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -725,7 +725,7 @@ { "name": "properties", "in": "body", - "description": "Resource create parameters.", + "description": "The resource properties to be updated.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -855,6 +855,10 @@ }, "readOnly": true }, + "ServiceGroup": { + "type": "object", + "description": "" + }, "Site": { "type": "object", "description": "Site as ARM Resource", diff --git a/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json b/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json index 6ed9bd604a11..2c6ac4f941e2 100644 --- a/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json +++ b/specification/edge/resource-manager/Microsoft.Edge/sites/stable/2025-06-01/sites.json @@ -468,7 +468,7 @@ { "name": "properties", "in": "body", - "description": "Resource create parameters.", + "description": "The resource properties to be updated.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -725,7 +725,7 @@ { "name": "properties", "in": "body", - "description": "Resource create parameters.", + "description": "The resource properties to be updated.", "required": true, "schema": { "$ref": "#/definitions/SiteUpdate" @@ -855,6 +855,10 @@ }, "readOnly": true }, + "ServiceGroup": { + "type": "object", + "description": "" + }, "Site": { "type": "object", "description": "Site as ARM Resource", From d9e0d80b354329cd9cdf4b8943cb34128f214de8 Mon Sep 17 00:00:00 2001 From: Arcturus Zhang Date: Fri, 26 Sep 2025 11:17:45 +0800 Subject: [PATCH 7/7] update --- specification/edge/Microsoft.Edge.Sites.Management/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/edge/Microsoft.Edge.Sites.Management/client.tsp b/specification/edge/Microsoft.Edge.Sites.Management/client.tsp index 5f31d735b744..ec2e9f1e4104 100644 --- a/specification/edge/Microsoft.Edge.Sites.Management/client.tsp +++ b/specification/edge/Microsoft.Edge.Sites.Management/client.tsp @@ -17,3 +17,4 @@ using Microsoft.Edge; ); @@clientName(SiteUpdate, "EdgeSitePatch", "csharp"); @@clientName(SiteUpdateProperties, "EdgeSitePatchProperties", "csharp"); +@@clientName(SiteAddressProperties, "EdgeSiteAddressProperties", "csharp");