Skip to content

Commit

Permalink
Reopen Tests ARM, test case for ExtensionResource
Browse files Browse the repository at this point in the history
  • Loading branch information
v-hongli1 committed Oct 31, 2024
1 parent 2ec599b commit a94977f
Show file tree
Hide file tree
Showing 3 changed files with 389 additions and 29 deletions.
131 changes: 130 additions & 1 deletion packages/cadl-ranch-specs/cadl-ranch-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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": <any date>,
"lastModifiedBy": "AzureSDK",
"lastModifiedAt": <any date>,
"lastModifiedByType": "User",
}
}
```

### Azure_ResourceManager_Resources_ExtensionsResources_delete

- Endpoint: `delete https://management.azure.com`
Expand All @@ -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`
Expand Down Expand Up @@ -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": <any date>,
"lastModifiedBy": "AzureSDK",
"lastModifiedAt": <any date>,
"lastModifiedByType": "User",
}
}
```

### Azure_ResourceManager_Resources_ExtensionsResources_listByParent

- Endpoint: `get https://management.azure.com`
Expand Down Expand Up @@ -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": <any date>,
"lastModifiedBy": "AzureSDK",
"lastModifiedAt": <any date>,
"lastModifiedByType": "User",
}
}]
}
```

### Azure_ResourceManager_Resources_ExtensionsResources_update

- Endpoint: `patch https://management.azure.com`
Expand Down Expand Up @@ -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": <any date>,
"lastModifiedBy": "AzureSDK",
"lastModifiedAt": <any date>,
"lastModifiedByType": "User",
}
}
```

### Azure_ResourceManager_Resources_Nested_createOrReplace

- Endpoint: `put https://management.azure.com`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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": <any date>,
"lastModifiedBy": "AzureSDK",
"lastModifiedAt": <any date>,
"lastModifiedByType": "User",
}
}
```
""")
get is ArmResourceRead<ExtensionsResource>;

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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": <any date>,
"lastModifiedBy": "AzureSDK",
"lastModifiedAt": <any date>,
"lastModifiedByType": "User",
}
}
```
""")
createOrUpdate is ArmResourceCreateOrReplaceAsync<ExtensionsResource>;

Expand Down Expand Up @@ -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": <any date>,
"lastModifiedBy": "AzureSDK",
"lastModifiedAt": <any date>,
"lastModifiedByType": "User",
}
}
```
""")
update is ArmResourcePatchSync<ExtensionsResource, ExtensionsResourceProperties>;

Expand All @@ -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<ExtensionsResource>;

Expand Down Expand Up @@ -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": <any date>,
"lastModifiedBy": "AzureSDK",
"lastModifiedAt": <any date>,
"lastModifiedByType": "User",
}
}]
}
```
""")
listByParent is ArmResourceListByParent<ExtensionsResource>;
}
Loading

0 comments on commit a94977f

Please sign in to comment.