From a94977fd2b79ac39cf8aeae430524dcbcc4c4a87 Mon Sep 17 00:00:00 2001 From: hongli750210 Date: Thu, 31 Oct 2024 13:47:28 +0800 Subject: [PATCH] Reopen Tests ARM, test case for ExtensionResource --- .../cadl-ranch-specs/cadl-ranch-summary.md | 131 ++++++++++++++- .../resource-manager/resources/extension.tsp | 131 ++++++++++++++- .../resource-manager/resources/mockapi.ts | 156 +++++++++++++++--- 3 files changed, 389 insertions(+), 29 deletions(-) diff --git a/packages/cadl-ranch-specs/cadl-ranch-summary.md b/packages/cadl-ranch-specs/cadl-ranch-summary.md index 383bf68fc..d0615f7ed 100644 --- a/packages/cadl-ranch-specs/cadl-ranch-summary.md +++ b/packages/cadl-ranch-specs/cadl-ranch-summary.md @@ -947,7 +947,7 @@ Expected response body: ``` Resource PUT operation. - Expected path: /providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected path: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/extensionsResources/extension Expected query parameter: api-version=2023-12-01-preview Expected request body: @@ -1016,6 +1016,41 @@ Expected response body: } ``` + Resource PUT operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected query parameter: api-version=2023-12-01-preview + + Expected request body: + + ```json + { + "properties":{ + "description": "valid", + } + ``` + + Expected response body: + + ```json + { + "id": "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension", + "name": "extension", + "type": "Azure.ResourceManager.Resources/extensionsResources", + "properties":{ + "description": "valid", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdBy": "AzureSDK", + "createdByType": "User", + "createdAt": , + "lastModifiedBy": "AzureSDK", + "lastModifiedAt": , + "lastModifiedByType": "User", + } + } + ``` + ### Azure_ResourceManager_Resources_ExtensionsResources_delete - Endpoint: `delete https://management.azure.com` @@ -1035,6 +1070,11 @@ Expected response body: Expected query parameter: api-version=2023-12-01-preview Expected response status code: 204 + Resource DELETE operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected query parameter: api-version=2023-12-01-preview + Expected response status code: 204 + ### Azure_ResourceManager_Resources_ExtensionsResources_get - Endpoint: `get https://management.azure.com` @@ -1117,6 +1157,32 @@ Expected response body: } ``` + Resource GET operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected query parameter: api-version=2023-12-01-preview + + Expected response body: + + ```json + { + "id": "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension", + "name": "extension", + "type": "Azure.ResourceManager.Resources/extensionsResources", + "properties":{ + "description": "valid", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdBy": "AzureSDK", + "createdByType": "User", + "createdAt": , + "lastModifiedBy": "AzureSDK", + "lastModifiedAt": , + "lastModifiedByType": "User", + } + } + ``` + ### Azure_ResourceManager_Resources_ExtensionsResources_listByParent - Endpoint: `get https://management.azure.com` @@ -1205,6 +1271,34 @@ Expected response body: } ``` + Resource LIST by parent url operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionResources + Expected query parameter: api-version=2023-12-01-preview + + Expected response body: + + ```json + { + "value": [{ + "id": "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension", + "name": "extension", + "type": "Azure.ResourceManager.Resources/extensionsResources", + "properties":{ + "description": "valid", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdBy": "AzureSDK", + "createdByType": "User", + "createdAt": , + "lastModifiedBy": "AzureSDK", + "lastModifiedAt": , + "lastModifiedByType": "User", + } + }] + } + ``` + ### Azure_ResourceManager_Resources_ExtensionsResources_update - Endpoint: `patch https://management.azure.com` @@ -1314,6 +1408,41 @@ Expected response body: } ``` + Resource Patch operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected query parameter: api-version=2023-12-01-preview + + Expected request body: + + ```json + { + "properties":{ + "description": "valid2", + } + ``` + + Expected response body: + + ```json + { + "id": "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension", + "name": "extension", + "type": "Azure.ResourceManager.Resources/extensionsResources", + "properties":{ + "description": "valid2", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdBy": "AzureSDK", + "createdByType": "User", + "createdAt": , + "lastModifiedBy": "AzureSDK", + "lastModifiedAt": , + "lastModifiedByType": "User", + } + } + ``` + ### Azure_ResourceManager_Resources_Nested_createOrReplace - Endpoint: `put https://management.azure.com` diff --git a/packages/cadl-ranch-specs/http/azure/resource-manager/resources/extension.tsp b/packages/cadl-ranch-specs/http/azure/resource-manager/resources/extension.tsp index ae253afda..31778f26f 100644 --- a/packages/cadl-ranch-specs/http/azure/resource-manager/resources/extension.tsp +++ b/packages/cadl-ranch-specs/http/azure/resource-manager/resources/extension.tsp @@ -25,6 +25,9 @@ model ExtensionsResourceProperties { provisioningState?: ProvisioningState; } +/** The interface of extensions resources, + * it contains 4 kinds of URLs (resource, resource group, subscription and tenant) + */ @armResourceOperations interface ExtensionsResources { @scenario @@ -53,6 +56,7 @@ interface ExtensionsResources { } } ``` + Resource GET operation. Expected path: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/extensionsResources/extension Expected query parameter: api-version=2023-12-01-preview @@ -77,6 +81,7 @@ interface ExtensionsResources { } } ``` + Resource GET operation. Expected path: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/extensionsResources/extension Expected query parameter: api-version=2023-12-01-preview @@ -101,6 +106,31 @@ interface ExtensionsResources { } } ``` + + Resource GET operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected query parameter: api-version=2023-12-01-preview + + Expected response body: + ```json + { + "id": "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension", + "name": "extension", + "type": "Azure.ResourceManager.Resources/extensionsResources", + "properties":{ + "description": "valid", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdBy": "AzureSDK", + "createdByType": "User", + "createdAt": , + "lastModifiedBy": "AzureSDK", + "lastModifiedAt": , + "lastModifiedByType": "User", + } + } + ``` """) get is ArmResourceRead; @@ -140,7 +170,7 @@ interface ExtensionsResources { ``` Resource PUT operation. - Expected path: /providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected path: /subscriptions/00000000-0000-0000-0000-000000000000/providers/Azure.ResourceManager.Resources/extensionsResources/extension Expected query parameter: api-version=2023-12-01-preview Expected request body: @@ -171,6 +201,7 @@ interface ExtensionsResources { } } ``` + Resource PUT operation. Expected path: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/extensionsResources/extension Expected query parameter: api-version=2023-12-01-preview @@ -203,6 +234,39 @@ interface ExtensionsResources { } } ``` + + Resource PUT operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected query parameter: api-version=2023-12-01-preview + + Expected request body: + ```json + { + "properties":{ + "description": "valid", + } + ``` + + Expected response body: + ```json + { + "id": "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension", + "name": "extension", + "type": "Azure.ResourceManager.Resources/extensionsResources", + "properties":{ + "description": "valid", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdBy": "AzureSDK", + "createdByType": "User", + "createdAt": , + "lastModifiedBy": "AzureSDK", + "lastModifiedAt": , + "lastModifiedByType": "User", + } + } + ``` """) createOrUpdate is ArmResourceCreateOrReplaceAsync; @@ -306,6 +370,39 @@ interface ExtensionsResources { } } ``` + + Resource Patch operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected query parameter: api-version=2023-12-01-preview + + Expected request body: + ```json + { + "properties":{ + "description": "valid2", + } + ``` + + Expected response body: + ```json + { + "id": "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension", + "name": "extension", + "type": "Azure.ResourceManager.Resources/extensionsResources", + "properties":{ + "description": "valid2", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdBy": "AzureSDK", + "createdByType": "User", + "createdAt": , + "lastModifiedBy": "AzureSDK", + "lastModifiedAt": , + "lastModifiedByType": "User", + } + } + ``` """) update is ArmResourcePatchSync; @@ -325,6 +422,11 @@ interface ExtensionsResources { Expected path: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Azure.ResourceManager.Resources/extensionsResources/extension Expected query parameter: api-version=2023-12-01-preview Expected response status code: 204 + + Resource DELETE operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension + Expected query parameter: api-version=2023-12-01-preview + Expected response status code: 204 """) delete is ArmResourceDeleteSync; @@ -410,6 +512,33 @@ interface ExtensionsResources { }] } ``` + + Resource LIST by parent url operation. + Expected path: /providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionResources + Expected query parameter: api-version=2023-12-01-preview + + Expected response body: + ```json + { + "value": [{ + "id": "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension", + "name": "extension", + "type": "Azure.ResourceManager.Resources/extensionsResources", + "properties":{ + "description": "valid", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdBy": "AzureSDK", + "createdByType": "User", + "createdAt": , + "lastModifiedBy": "AzureSDK", + "lastModifiedAt": , + "lastModifiedByType": "User", + } + }] + } + ``` """) listByParent is ArmResourceListByParent; } diff --git a/packages/cadl-ranch-specs/http/azure/resource-manager/resources/mockapi.ts b/packages/cadl-ranch-specs/http/azure/resource-manager/resources/mockapi.ts index 2d8bbdbb1..63c2b4770 100644 --- a/packages/cadl-ranch-specs/http/azure/resource-manager/resources/mockapi.ts +++ b/packages/cadl-ranch-specs/http/azure/resource-manager/resources/mockapi.ts @@ -62,7 +62,7 @@ const validSingletonResource = { }; const validResourceGroupExtensionsResource = { - id: `/subscriptions/${SUBSCRIPTION_ID_EXPECTED}/resourceGroups/${RESOURCE_GROUP_EXPECTED}/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension`, + id: `/subscriptions/${SUBSCRIPTION_ID_EXPECTED}/resourceGroups/${RESOURCE_GROUP_EXPECTED}/providers/Azure.ResourceManager.Resources/extensionsResources/extension`, name: "extension", type: "Azure.ResourceManager.Resources/extensionsResources", properties: { @@ -80,7 +80,7 @@ const validResourceGroupExtensionsResource = { }; const validSubscriptionExtensionsResource = { - id: `/subscriptions/${SUBSCRIPTION_ID_EXPECTED}/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension`, + id: `/subscriptions/${SUBSCRIPTION_ID_EXPECTED}/providers/Azure.ResourceManager.Resources/extensionsResources/extension`, name: "extension", type: "Azure.ResourceManager.Resources/extensionsResources", properties: { @@ -98,6 +98,24 @@ const validSubscriptionExtensionsResource = { }; const validTenantExtensionsResource = { + id: `/providers/Azure.ResourceManager.Resources/extensionsResources/extension`, + name: "extension", + type: "Azure.ResourceManager.Resources/extensionsResources", + properties: { + description: "valid", + provisioningState: "Succeeded", + }, + systemData: { + createdBy: "AzureSDK", + createdByType: "User", + createdAt: new Date(), + lastModifiedBy: "AzureSDK", + lastModifiedAt: new Date(), + lastModifiedByType: "User", + }, +}; + +const validResourceExtensionsResource = { id: `/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/top/providers/Azure.ResourceManager.Resources/extensionsResources/extension`, name: "extension", type: "Azure.ResourceManager.Resources/extensionsResources", @@ -118,13 +136,12 @@ const validTenantExtensionsResource = { // extension tracked resource Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_get = passOnSuccess([ { - uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "get", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, "resourceGroup": RESOURCE_GROUP_EXPECTED, - "topLevelResourceName": "top", "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -136,12 +153,11 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_get = passOnSucces kind: "MockApiDefinition", }, { - uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "get", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, - "topLevelResourceName": "top", "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -153,11 +169,10 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_get = passOnSucces kind: "MockApiDefinition", }, { - uri: "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "get", request: { params: { - "topLevelResourceName": "top", "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -168,17 +183,32 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_get = passOnSucces }, kind: "MockApiDefinition", }, + { + uri: "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + method: "get", + request: { + params: { + "extensionName": "extension", + "topLevelResourceName": "top", + "api-version": "2023-12-01-preview", + }, + }, + response: { + status: 200, + body: json(validResourceExtensionsResource), + }, + kind: "MockApiDefinition", + }, ]); Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_createOrUpdate = passOnSuccess([ { - uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "put", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, "resourceGroup": RESOURCE_GROUP_EXPECTED, - "topLevelResourceName": "top", "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -195,12 +225,11 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_createOrUpdate = p kind: "MockApiDefinition", }, { - uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "put", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, - "topLevelResourceName": "top", "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -216,6 +245,26 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_createOrUpdate = p }, kind: "MockApiDefinition", }, + { + uri: "/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + method: "put", + request: { + params: { + "extensionName": "extension", + "api-version": "2023-12-01-preview", + }, + body: { + properties: { + description: "valid", + }, + }, + }, + response: { + status: 200, + body: json(validTenantExtensionsResource), + }, + kind: "MockApiDefinition", + }, { uri: "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "put", @@ -233,7 +282,7 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_createOrUpdate = p }, response: { status: 200, - body: json(validTenantExtensionsResource), + body: json(validResourceExtensionsResource), }, kind: "MockApiDefinition", }, @@ -241,13 +290,12 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_createOrUpdate = p Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_update = passOnSuccess([ { - uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "patch", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, "resourceGroup": RESOURCE_GROUP_EXPECTED, - "topLevelResourceName": "top", "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -273,12 +321,11 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_update = passOnSuc kind: "MockApiDefinition", }, { - uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "patch", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, - "topLevelResourceName": "top", "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -303,6 +350,35 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_update = passOnSuc }, kind: "MockApiDefinition", }, + { + uri: "/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + method: "patch", + request: { + params: { + "extensionName": "extension", + "api-version": "2023-12-01-preview", + }, + body: { + properties: { + description: "valid2", + }, + }, + headers: { + "Content-Type": "application/merge-patch+json", + }, + }, + response: { + status: 200, + body: json({ + ...validTenantExtensionsResource, + properties: { + provisioningState: "Succeeded", + description: "valid2", + }, + }), + }, + kind: "MockApiDefinition", + }, { uri: "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "patch", @@ -324,7 +400,7 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_update = passOnSuc response: { status: 200, body: json({ - ...validTenantExtensionsResource, + ...validResourceExtensionsResource, properties: { provisioningState: "Succeeded", description: "valid2", @@ -337,13 +413,12 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_update = passOnSuc Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_delete = passOnSuccess([ { - uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "delete", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, "resourceGroup": RESOURCE_GROUP_EXPECTED, - "topLevelResourceName": "top", "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -354,12 +429,25 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_delete = passOnSuc kind: "MockApiDefinition", }, { - uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", method: "delete", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, - "topLevelResourceName": "top", + "extensionName": "extension", + "api-version": "2023-12-01-preview", + }, + }, + response: { + status: 204, + }, + kind: "MockApiDefinition", + }, + { + uri: "/providers/Azure.ResourceManager.Resources/extensionsResources/:extensionName", + method: "delete", + request: { + params: { "extensionName": "extension", "api-version": "2023-12-01-preview", }, @@ -388,13 +476,12 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_delete = passOnSuc Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_listByParent = passOnSuccess([ { - uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources", + uri: "/subscriptions/:subscriptionId/resourceGroups/:resourceGroup/providers/Azure.ResourceManager.Resources/extensionsResources", method: "get", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, "resourceGroup": RESOURCE_GROUP_EXPECTED, - "topLevelResourceName": "top", "api-version": "2023-12-01-preview", }, }, @@ -407,12 +494,11 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_listByParent = pas kind: "MockApiDefinition", }, { - uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources", + uri: "/subscriptions/:subscriptionId/providers/Azure.ResourceManager.Resources/extensionsResources", method: "get", request: { params: { "subscriptionId": SUBSCRIPTION_ID_EXPECTED, - "topLevelResourceName": "top", "api-version": "2023-12-01-preview", }, }, @@ -424,6 +510,22 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_listByParent = pas }, kind: "MockApiDefinition", }, + { + uri: "/providers/Azure.ResourceManager.Resources/extensionsResources", + method: "get", + request: { + params: { + "api-version": "2023-12-01-preview", + }, + }, + response: { + status: 200, + body: json({ + value: [validTenantExtensionsResource], + }), + }, + kind: "MockApiDefinition", + }, { uri: "/providers/Azure.ResourceManager.Resources/topLevelTrackedResources/:topLevelResourceName/providers/Azure.ResourceManager.Resources/extensionsResources", method: "get", @@ -436,7 +538,7 @@ Scenarios.Azure_ResourceManager_Resources_ExtensionsResources_listByParent = pas response: { status: 200, body: json({ - value: [validTenantExtensionsResource], + value: [validResourceExtensionsResource], }), }, kind: "MockApiDefinition",