From 0ecf0dd890b63837637352c35ff00de342e2a083 Mon Sep 17 00:00:00 2001 From: mohit1706 <93733791+mohit1706@users.noreply.github.com> Date: Tue, 11 Apr 2023 14:47:51 +0530 Subject: [PATCH] Remove unused command and added example Remove unused command and added example --- .../tests/latest/create_discover.json | 4 - .../recordings/test_invoke_commands.yaml | 70 +--- ...est_workloads_svi_new_child_instances.yaml | 299 --------------- .../recordings/test_workloads_svi_remove.yaml | 352 ++++++++++++++++++ .../tests/latest/test_workloads.py | 33 +- 5 files changed, 366 insertions(+), 392 deletions(-) delete mode 100644 src/workloads/azext_workloads/tests/latest/create_discover.json delete mode 100644 src/workloads/azext_workloads/tests/latest/recordings/test_workloads_svi_new_child_instances.yaml create mode 100644 src/workloads/azext_workloads/tests/latest/recordings/test_workloads_svi_remove.yaml diff --git a/src/workloads/azext_workloads/tests/latest/create_discover.json b/src/workloads/azext_workloads/tests/latest/create_discover.json deleted file mode 100644 index ac98dad4643..00000000000 --- a/src/workloads/azext_workloads/tests/latest/create_discover.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "configurationType": "Discovery", - "centralServerVmId": "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/CLI-TestRG/providers/Microsoft.Compute/virtualMachines/c36ascsvm" -} \ No newline at end of file diff --git a/src/workloads/azext_workloads/tests/latest/recordings/test_invoke_commands.yaml b/src/workloads/azext_workloads/tests/latest/recordings/test_invoke_commands.yaml index eecbed9d2bb..533679955b9 100644 --- a/src/workloads/azext_workloads/tests/latest/recordings/test_invoke_commands.yaml +++ b/src/workloads/azext_workloads/tests/latest/recordings/test_invoke_commands.yaml @@ -1,60 +1,4 @@ interactions: -- request: - body: '{"appLocation": "northeurope", "databaseType": "HANA", "sapProduct": "S4HANA"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - workloads sap-availability-zone-detail - Connection: - - keep-alive - Content-Length: - - '78' - Content-Type: - - application/json - ParameterSetName: - - --app-location --database-type --sap-product --location - User-Agent: - - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/northeurope/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails?api-version=2023-04-01 - response: - body: - string: '{"availabilityZonePairs":[{"zoneA":2,"zoneB":3}]}' - headers: - api-supported-versions: - - 2021-12-01-preview, 2022-10-15-preview, 2022-11-01-preview, 2023-04-01 - cache-control: - - no-cache - content-length: - - '49' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 10 Apr 2023 18:51:27 GMT - expires: - - '-1' - mise-correlation-id: - - 7c083271-1c4c-47a5-8f31-a673e9fcc166 - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK - request: body: '{"appLocation": "eastus", "databaseType": "HANA", "dbVmSku": "Standard_M32ts", "deploymentType": "SingleServer", "environment": "NonProd", "sapProduct": "S4HANA"}' @@ -91,11 +35,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 10 Apr 2023 18:51:30 GMT + - Tue, 11 Apr 2023 09:08:36 GMT expires: - '-1' mise-correlation-id: - - 0e264aed-aa7f-4c3e-ac47-95e40f7ec97f + - cad63d2e-5a8d-4a91-8787-45d8411593cf pragma: - no-cache strict-transport-security: @@ -150,11 +94,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 10 Apr 2023 18:51:33 GMT + - Tue, 11 Apr 2023 09:08:39 GMT expires: - '-1' mise-correlation-id: - - d17bcafe-3a7a-452d-848a-9659a60689b7 + - 84c3fce2-f994-47bf-b229-7a7373030aa4 pragma: - no-cache strict-transport-security: @@ -208,11 +152,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 10 Apr 2023 18:51:35 GMT + - Tue, 11 Apr 2023 09:08:43 GMT expires: - '-1' mise-correlation-id: - - d983ff90-d6d9-40a1-8cd2-86e78bb71b4d + - 1c093710-d67c-4786-aef9-166e3a620ce2 pragma: - no-cache strict-transport-security: @@ -226,7 +170,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK diff --git a/src/workloads/azext_workloads/tests/latest/recordings/test_workloads_svi_new_child_instances.yaml b/src/workloads/azext_workloads/tests/latest/recordings/test_workloads_svi_new_child_instances.yaml deleted file mode 100644 index 814f6ba732f..00000000000 --- a/src/workloads/azext_workloads/tests/latest/recordings/test_workloads_svi_new_child_instances.yaml +++ /dev/null @@ -1,299 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - workloads sap-application-server-instance create - Connection: - - keep-alive - ParameterSetName: - - --sap-virtual-instance-name -g -n - User-Agent: - - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/CLI-TESTING?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING","name":"CLI-TESTING","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"Created":"20230330"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '249' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 10 Apr 2023 10:02:30 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "eastus"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - workloads sap-application-server-instance create - Connection: - - keep-alive - Content-Length: - - '22' - Content-Type: - - application/json - ParameterSetName: - - --sap-virtual-instance-name -g -n - User-Agent: - - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36/applicationInstances/c36appvm0-1?api-version=2023-04-01 - response: - body: - string: '{"error":{"code":"OperationNotAllowed","message":"This operation is - not allowed."}}' - headers: - api-supported-versions: - - 2021-12-01-preview, 2022-10-15-preview, 2022-11-01-preview, 2023-04-01 - cache-control: - - no-cache - content-length: - - '83' - content-type: - - application/json - date: - - Mon, 10 Apr 2023 10:02:35 GMT - expires: - - '-1' - mise-correlation-id: - - 297c4822-d56b-4f27-9b6d-ce5141ab5c3c - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - workloads sap-database-instance create - Connection: - - keep-alive - ParameterSetName: - - --sap-virtual-instance-name -g -n - User-Agent: - - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/CLI-TESTING?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING","name":"CLI-TESTING","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"Created":"20230330"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '249' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 10 Apr 2023 10:02:36 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "eastus"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - workloads sap-database-instance create - Connection: - - keep-alive - Content-Length: - - '22' - Content-Type: - - application/json - ParameterSetName: - - --sap-virtual-instance-name -g -n - User-Agent: - - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36/databaseInstances/C36-0?api-version=2023-04-01 - response: - body: - string: '{"error":{"code":"OperationNotAllowed","message":"This operation is - not allowed."}}' - headers: - api-supported-versions: - - 2021-12-01-preview, 2022-10-15-preview, 2022-11-01-preview, 2023-04-01 - cache-control: - - no-cache - content-length: - - '83' - content-type: - - application/json - date: - - Mon, 10 Apr 2023 10:02:42 GMT - expires: - - '-1' - mise-correlation-id: - - 3e2e5119-660b-4e3c-adec-c9b60510bf26 - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - workloads sap-central-instance create - Connection: - - keep-alive - ParameterSetName: - - --sap-virtual-instance-name -g -n - User-Agent: - - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/CLI-TESTING?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING","name":"CLI-TESTING","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"Created":"20230330"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '249' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 10 Apr 2023 10:02:44 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "eastus"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - workloads sap-central-instance create - Connection: - - keep-alive - Content-Length: - - '22' - Content-Type: - - application/json - ParameterSetName: - - --sap-virtual-instance-name -g -n - User-Agent: - - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36/centralInstances/c36ascsvm-1?api-version=2023-04-01 - response: - body: - string: '{"error":{"code":"OperationNotAllowed","message":"This operation is - not allowed."}}' - headers: - api-supported-versions: - - 2021-12-01-preview, 2022-10-15-preview, 2022-11-01-preview, 2023-04-01 - cache-control: - - no-cache - content-length: - - '83' - content-type: - - application/json - date: - - Mon, 10 Apr 2023 10:02:50 GMT - expires: - - '-1' - mise-correlation-id: - - 3f1ff54f-e64e-4b04-aae5-cd8c66f7549c - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 400 - message: Bad Request -version: 1 diff --git a/src/workloads/azext_workloads/tests/latest/recordings/test_workloads_svi_remove.yaml b/src/workloads/azext_workloads/tests/latest/recordings/test_workloads_svi_remove.yaml new file mode 100644 index 00000000000..5f3ce6d0725 --- /dev/null +++ b/src/workloads/azext_workloads/tests/latest/recordings/test_workloads_svi_remove.yaml @@ -0,0 +1,352 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - workloads sap-virtual-instance delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36?api-version=2023-04-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 09:08:36 GMT + etag: + - '"6d00b197-0000-0100-0000-643523940000"' + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - workloads sap-virtual-instance delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","name":"2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36","status":"Deleting","startTime":"2023-04-11T09:08:36.6652028Z"}' + headers: + cache-control: + - no-cache + content-length: + - '549' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 09:09:07 GMT + etag: + - '"7b00a122-0000-0100-0000-643523940000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - workloads sap-virtual-instance delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","name":"2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36","status":"Deleting","startTime":"2023-04-11T09:08:36.6652028Z"}' + headers: + cache-control: + - no-cache + content-length: + - '549' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 09:09:36 GMT + etag: + - '"7b00a122-0000-0100-0000-643523940000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - workloads sap-virtual-instance delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","name":"2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36","status":"Deleting","startTime":"2023-04-11T09:08:36.6652028Z"}' + headers: + cache-control: + - no-cache + content-length: + - '549' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 09:10:07 GMT + etag: + - '"7b00a122-0000-0100-0000-643523940000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - workloads sap-virtual-instance delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","name":"2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36","status":"Deleting","startTime":"2023-04-11T09:08:36.6652028Z"}' + headers: + cache-control: + - no-cache + content-length: + - '549' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 09:10:38 GMT + etag: + - '"7b00a122-0000-0100-0000-643523940000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - workloads sap-virtual-instance delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","name":"2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36","status":"Deleting","startTime":"2023-04-11T09:08:36.6652028Z"}' + headers: + cache-control: + - no-cache + content-length: + - '549' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 09:11:08 GMT + etag: + - '"7b00a122-0000-0100-0000-643523940000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - workloads sap-virtual-instance delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","name":"2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36","status":"Deleting","startTime":"2023-04-11T09:08:36.6652028Z"}' + headers: + cache-control: + - no-cache + content-length: + - '549' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 09:11:38 GMT + etag: + - '"7b00a122-0000-0100-0000-643523940000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - workloads sap-virtual-instance delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630?api-version=2023-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Workloads/locations/EASTUS/operationStatuses/2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","name":"2ec7d565-d57f-4d53-b9e0-b06f00898f67*6F14B96698AE42F247D93F38E78B89C85F55FD5C3DACCE2FB375E09237D3E630","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/CLI-TESTING/providers/Microsoft.Workloads/sapVirtualInstances/C36","status":"Succeeded","startTime":"2023-04-11T09:08:36.6652028Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '568' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 09:12:09 GMT + etag: + - '"0000442c-0000-4d00-0000-643524500000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/workloads/azext_workloads/tests/latest/test_workloads.py b/src/workloads/azext_workloads/tests/latest/test_workloads.py index e2ca0e40d62..1a6136f04a5 100644 --- a/src/workloads/azext_workloads/tests/latest/test_workloads.py +++ b/src/workloads/azext_workloads/tests/latest/test_workloads.py @@ -186,29 +186,6 @@ def test_workloads_svi_update_tags(self): self.check('tags.tag2', 'test2') ]) - def test_workloads_svi_new_child_instances(self): - self.kwargs.update({ - 'name': 'C36', - 'appservername': 'c36appvm0-1', - 'csservername': 'c36ascsvm-1', - 'dbservername': 'C36-0' - }) - - try: - self.cmd('az workloads sap-application-server-instance create --sap-virtual-instance-name {name} -g CLI-TESTING -n {appservername}') - except Exception as ex: - self.assertTrue('This operation is not allowed' in str(ex)) - - try: - self.cmd('az workloads sap-database-instance create --sap-virtual-instance-name {name} -g CLI-TESTING -n {dbservername}') - except Exception as ex: - self.assertTrue('This operation is not allowed' in str(ex)) - - try: - self.cmd('az workloads sap-central-instance create --sap-virtual-instance-name {name} -g CLI-TESTING -n {csservername}') - except Exception as ex: - self.assertTrue('This operation is not allowed' in str(ex)) - @unittest.skip('recording file not getting generted properly throwing Subscription not found') def test_workloads_svi_discover(self): self.kwargs.update({ @@ -231,9 +208,6 @@ def test_invoke_commands(self): 'databasetype': 'HANA', 'sapproduct': 'S4HANA' }) - count = len(self.cmd('workloads sap-availability-zone-detail --app-location northeurope --database-type {databasetype} --sap-product {sapproduct} --location northeurope').get_output_in_json()) - self.assertTrue(count >= 1) - count = len(self.cmd('workloads sap-disk-configuration --app-location eastus --database-type {databasetype} --db-vm-sku Standard_M32ts --deployment-type SingleServer --environment NonProd --sap-product {sapproduct} --location eastus').get_output_in_json()) self.assertTrue(count >= 1) @@ -244,5 +218,12 @@ def test_invoke_commands(self): count = len(self.cmd('workloads sap-supported-sku --database-type {databasetype} --app-location eastus --location eastus --sap-product {sapproduct} --deployment-type ThreeTier --environment Prod').get_output_in_json()) self.assertTrue(count >= 1) + def test_workloads_svi_remove(self): + self.kwargs.update({ + 'name': 'C36' + }) + + self.cmd('workloads sap-virtual-instance delete -g CLI-TESTING -n {name} --yes') +