diff --git a/src/account/HISTORY.rst b/src/account/HISTORY.rst index f609ea48b2d..ff58ed4c0b9 100644 --- a/src/account/HISTORY.rst +++ b/src/account/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.2.1 ++++++ +* az account alias create: add --reseller-id + 0.2.0 +++++ * Breaking Change: remove `az account subscription create`. diff --git a/src/account/azext_account/generated/_params.py b/src/account/azext_account/generated/_params.py index 03eba5b0461..f04b068caa2 100644 --- a/src/account/azext_account/generated/_params.py +++ b/src/account/azext_account/generated/_params.py @@ -49,6 +49,7 @@ def load_arguments(self, _): 'LegacyEA') c.argument('subscription_id', type=str, help='This parameter can be used to create alias for existing ' 'subscription ID') + c.argument('reseller_id', type=str, help='Reseller ID, basically MPN Id') with self.argument_context('account alias delete') as c: c.argument('alias_name', options_list=['--name', '-n'], help='Alias Name') diff --git a/src/account/azext_account/generated/custom.py b/src/account/azext_account/generated/custom.py index 96e94c240c4..824ac5ff9de 100644 --- a/src/account/azext_account/generated/custom.py +++ b/src/account/azext_account/generated/custom.py @@ -57,12 +57,14 @@ def account_alias_create(client, billing_scope=None, display_name=None, subscription_id=None, + reseller_id=None, no_wait=False): properties = { 'display_name': display_name, 'workload': workload, 'billing_scope': billing_scope, - 'subscription_id': subscription_id + 'subscription_id': subscription_id, + 'reseller_id': reseller_id } return sdk_no_wait(no_wait, client.begin_create, diff --git a/src/account/azext_account/tests/latest/recordings/test_account.yaml b/src/account/azext_account/tests/latest/recordings/test_account.yaml index 2bfd74fd0e5..6917b960ab5 100644 --- a/src/account/azext_account/tests/latest/recordings/test_account.yaml +++ b/src/account/azext_account/tests/latest/recordings/test_account.yaml @@ -1,7 +1,8 @@ interactions: - request: body: '{"properties": {"displayName": "My Subscription", "workload": "Production", - "billingScope": "/providers/Microsoft.Billing/billingAccounts/9147924/enrollmentAccounts/253727"}}' + "billingScope": "/providers/Microsoft.Billing/billingAccounts/9147924/enrollmentAccounts/253727", + "resellerId": "5139005"}}' headers: Accept: - application/json @@ -12,13 +13,13 @@ interactions: Connection: - keep-alive Content-Length: - - '174' + - '199' Content-Type: - application/json ParameterSetName: - - --name --billing-scope --display-name --workload + - --name --billing-scope --display-name --workload --reseller-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias000001?api-version=2020-09-01 response: @@ -32,13 +33,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:09:22 GMT + - Mon, 19 Oct 2020 04:31:36 GMT expires: - '-1' pragma: - no-cache request-id: - - c1c02099-f330-4cd6-9ec9-8fafe691bc5f + - 1db87999-9969-4750-9a50-d161a84e01e8 server: - Microsoft-IIS/10.0 strict-transport-security: @@ -68,9 +69,9 @@ interactions: Connection: - keep-alive ParameterSetName: - - --name --billing-scope --display-name --workload + - --name --billing-scope --display-name --workload --reseller-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias000001?api-version=2020-09-01 response: @@ -84,13 +85,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:09:52 GMT + - Mon, 19 Oct 2020 04:32:06 GMT expires: - '-1' pragma: - no-cache request-id: - - 6707b895-b8b5-41c2-b50e-11bdf8dab99a + - 97329b98-8bab-4e54-89a5-e2bdeef30ed1 server: - Microsoft-IIS/10.0 strict-transport-security: @@ -124,7 +125,7 @@ interactions: ParameterSetName: - -n User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias000001?api-version=2020-09-01 response: @@ -138,13 +139,65 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:09:55 GMT + - Mon, 19 Oct 2020 04:32:09 GMT expires: - '-1' pragma: - no-cache request-id: - - 582ad076-64bb-4f41-ba16-fc1e91479232 + - 1a223f4d-05ad-49b6-a0b0-8201f1d71a89 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-gsm: + - 1.0.0.0 + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases?api-version=2020-09-01 + response: + body: + string: '{"value":[{"id":"/providers/Microsoft.Subscription/aliases/cli_alias000001","name":"cli_alias000001","type":"Microsoft.Subscription/aliases","properties":{"subscriptionId":"00000000-0000-0000-0000-000000000000","provisioningState":"Succeeded"}},{"id":"/providers/Microsoft.Subscription/aliases/cli_aliasz2vped63fbilta3","name":"cli_aliasz2vped63fbilta3","type":"Microsoft.Subscription/aliases","properties":{"subscriptionId":"8ce5b704-34d5-4c0e-8551-cc5fab0e0784","provisioningState":"Succeeded"}},{"id":"/providers/Microsoft.Subscription/aliases/cli_alias_newsgdbu7csc2j","name":"cli_alias_newsgdbu7csc2j","type":"Microsoft.Subscription/aliases","properties":{"subscriptionId":"8338eecb-3bd3-4162-a212-80452f84f3b3","provisioningState":"Succeeded"}},{"id":"/providers/Microsoft.Subscription/aliases/cli_aliasdxbzpmqagecs5zq","name":"cli_aliasdxbzpmqagecs5zq","type":"Microsoft.Subscription/aliases","properties":{"subscriptionId":"d50bf18c-e268-4da7-81cb-c752f2323415","provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1023' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:32:12 GMT + expires: + - '-1' + pragma: + - no-cache + request-id: + - b71d2a01-738f-4e5f-8a24-403c38f1b07c server: - Microsoft-IIS/10.0 strict-transport-security: @@ -176,24 +229,31 @@ interactions: Connection: - keep-alive User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions?api-version=2016-06-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"4b7571aa-8a25-4e1e-b884-e9a33cea95c5","displayName":"TestingLimit1-100","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"86bc4fb6-0fc8-4db5-8568-2f8aeb998e4c","displayName":"cli_subos5rknc3e66p3iniq","state":"Warned","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"6aaa903e-7c45-4492-8d3c-ef882bc009b5","displayName":"Feng + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"4b7571aa-8a25-4e1e-b884-e9a33cea95c5","displayName":"TestingLimit1-100","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"86bc4fb6-0fc8-4db5-8568-2f8aeb998e4c","displayName":"cli_subos5rknc3e66p3iniq","state":"Disabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"6aaa903e-7c45-4492-8d3c-ef882bc009b5","displayName":"Feng Alias Subscription 2","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"e35ea3b7-3091-4787-9216-d0b90889234f","displayName":"My - Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Disabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"e3d4b083-25f4-4418-ac6e-e94ac4974560","displayName":"My + Big Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"bf46ae24-b93e-42b8-b9c2-8f910a8d5d07","displayName":"Feng + Alias Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"bab9215e-6f79-467b-969a-c758934700d9","displayName":"My + Subscription","state":"Disabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"996e8f3d-9765-4bee-a716-b693914b30b5","displayName":"My + Subscription","state":"Disabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"8ce5b704-34d5-4c0e-8551-cc5fab0e0784","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"d50bf18c-e268-4da7-81cb-c752f2323415","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"8338eecb-3bd3-4162-a212-80452f84f3b3","displayName":"My + Big Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}]}' headers: cache-control: - no-cache content-length: - - '1681' + - '4012' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:09:56 GMT + - Mon, 19 Oct 2020 04:32:13 GMT expires: - '-1' pragma: @@ -221,7 +281,7 @@ interactions: ParameterSetName: - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: @@ -236,7 +296,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:09:57 GMT + - Mon, 19 Oct 2020 04:32:13 GMT expires: - '-1' pragma: @@ -264,7 +324,7 @@ interactions: ParameterSetName: - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2016-06-01 response: @@ -319,7 +379,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:09:57 GMT + - Mon, 19 Oct 2020 04:32:14 GMT expires: - '-1' pragma: @@ -349,7 +409,7 @@ interactions: ParameterSetName: - --subscription-id --yes User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Subscription/cancel?api-version=2020-09-01 response: @@ -363,13 +423,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:10:02 GMT + - Mon, 19 Oct 2020 04:32:18 GMT expires: - '-1' pragma: - no-cache request-id: - - 74add5cb-3703-4e92-a22d-b6d7f60cba6a + - e45adf23-6f80-4456-86f6-2586e87a92ba server: - Microsoft-IIS/10.0 strict-transport-security: @@ -405,7 +465,93 @@ interactions: ParameterSetName: - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + headers: + cache-control: + - no-cache + content-length: + - '329' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:37:20 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account subscription show + Connection: + - keep-alive + ParameterSetName: + - --subscription-id + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + headers: + cache-control: + - no-cache + content-length: + - '329' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:40:20 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account subscription show + Connection: + - keep-alive + ParameterSetName: + - --subscription-id + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: @@ -420,7 +566,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:15:02 GMT + - Mon, 19 Oct 2020 04:43:20 GMT expires: - '-1' pragma: @@ -442,53 +588,38 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - account subscription enable + - account subscription show Connection: - keep-alive - Content-Length: - - '0' ParameterSetName: - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Subscription/enable?api-version=2020-09-01 + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: body: - string: '{"subscriptionId":"00000000-0000-0000-0000-000000000000"}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Warned","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' headers: cache-control: - no-cache content-length: - - '57' + - '328' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:15:07 GMT + - Mon, 19 Oct 2020 04:43:21 GMT expires: - '-1' pragma: - no-cache - request-id: - - 258279d2-320a-4af0-a384-5de245323cf5 - server: - - Microsoft-IIS/10.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked vary: - - Accept-Encoding,Accept-Encoding - x-aspnet-version: - - 4.0.30319 + - Accept-Encoding x-content-type-options: - nosniff - x-gsm: - - 1.0.0.0 - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-powered-by: - - ASP.NET status: code: 200 message: OK @@ -506,22 +637,22 @@ interactions: ParameterSetName: - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My - Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + Subscription","state":"Warned","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' headers: cache-control: - no-cache content-length: - - '329' + - '328' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:20:08 GMT + - Mon, 19 Oct 2020 04:43:22 GMT expires: - '-1' pragma: @@ -536,26 +667,24 @@ interactions: code: 200 message: OK - request: - body: '{"subscriptionName": "My Big Subscription"}' + body: null headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - account subscription rename + - account subscription enable Connection: - keep-alive Content-Length: - - '43' - Content-Type: - - application/json + - '0' ParameterSetName: - - --subscription-id --name + - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Subscription/rename?api-version=2020-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Subscription/enable?api-version=2020-09-01 response: body: string: '{"subscriptionId":"00000000-0000-0000-0000-000000000000"}' @@ -567,13 +696,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:20:12 GMT + - Mon, 19 Oct 2020 04:43:27 GMT expires: - '-1' pragma: - no-cache request-id: - - f3f68d09-b145-4b03-91ee-b1ab5a5ed5f1 + - 9393ea98-4d25-4973-aa19-8b6e84375f50 server: - Microsoft-IIS/10.0 strict-transport-security: @@ -609,7 +738,7 @@ interactions: ParameterSetName: - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: @@ -624,7 +753,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 09:25:12 GMT + - Mon, 19 Oct 2020 04:48:28 GMT expires: - '-1' pragma: @@ -652,22 +781,22 @@ interactions: ParameterSetName: - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My - Big Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + Subscription","state":"Warned","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' headers: cache-control: - no-cache content-length: - - '333' + - '328' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 12:20:37 GMT + - Mon, 19 Oct 2020 04:51:28 GMT expires: - '-1' pragma: @@ -689,25 +818,28 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - account tenant list + - account subscription show Connection: - keep-alive + ParameterSetName: + - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/tenants?api-version=2016-06-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: body: - string: '{"value":[{"id":"/tenants/e8abe575-baa6-4436-af8a-dbf3eeb3a857","tenantId":"e8abe575-baa6-4436-af8a-dbf3eeb3a857"}]}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' headers: cache-control: - no-cache content-length: - - '116' + - '329' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 12:20:39 GMT + - Mon, 19 Oct 2020 04:54:28 GMT expires: - '-1' pragma: @@ -725,114 +857,965 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: - - account alias delete + - account subscription show Connection: - keep-alive - Content-Length: - - '0' ParameterSetName: - - -n + - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias000001?api-version=2020-09-01 + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: body: - string: '' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' headers: cache-control: - no-cache content-length: - - '0' + - '329' + content-type: + - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 12:20:42 GMT + - Mon, 19 Oct 2020 04:54:29 GMT expires: - '-1' pragma: - no-cache - request-id: - - 9ee56908-7fab-4306-99cb-e2e053918afc - server: - - Microsoft-IIS/10.0 strict-transport-security: - max-age=31536000; includeSubDomains - x-aspnet-version: - - 4.0.30319 + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-gsm: - - 1.0.0.0 - x-ms-ratelimit-remaining-tenant-deletes: - - '14999' - x-powered-by: - - ASP.NET status: code: 200 message: OK - request: - body: '{"properties": {"workload": "Production", "subscriptionId": "00000000-0000-0000-0000-000000000000"}}' + body: null headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - account alias create + - account subscription show Connection: - keep-alive - Content-Length: - - '100' - Content-Type: - - application/json ParameterSetName: - - --name --workload --subscription-id + - --subscription-id User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) - method: PUT - uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 response: body: - string: '{"id":"/providers/Microsoft.Subscription/aliases/cli_alias_new000002","name":"cli_alias_new000002","type":"Microsoft.Subscription/aliases","properties":{"subscriptionId":"00000000-0000-0000-0000-000000000000","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' headers: cache-control: - no-cache content-length: - - '252' + - '329' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Sep 2020 12:20:45 GMT + - Mon, 19 Oct 2020 04:54:30 GMT expires: - '-1' pragma: - no-cache - request-id: - - d6f3d475-ee3e-4529-b28a-b985a191b268 - server: - - Microsoft-IIS/10.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked vary: - - Accept-Encoding,Accept-Encoding - x-aspnet-version: - - 4.0.30319 + - Accept-Encoding x-content-type-options: - nosniff - x-gsm: - - 1.0.0.0 - x-ms-ratelimit-remaining-tenant-writes: - - '1199' - x-powered-by: - - ASP.NET status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account subscription show + Connection: + - keep-alive + ParameterSetName: + - --subscription-id + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + headers: + cache-control: + - no-cache + content-length: + - '329' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:54: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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account subscription show + Connection: + - keep-alive + ParameterSetName: + - --subscription-id + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Warned","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + headers: + cache-control: + - no-cache + content-length: + - '328' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:54:31 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account subscription show + Connection: + - keep-alive + ParameterSetName: + - --subscription-id + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + headers: + cache-control: + - no-cache + content-length: + - '329' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:57:31 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account subscription show + Connection: + - keep-alive + ParameterSetName: + - --subscription-id + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + headers: + cache-control: + - no-cache + content-length: + - '329' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:57:32 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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account subscription show + Connection: + - keep-alive + ParameterSetName: + - --subscription-id + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000","authorizationSource":"Legacy","subscriptionId":"00000000-0000-0000-0000-000000000000","displayName":"My + Subscription","state":"Enabled","subscriptionPolicies":{"locationPlacementId":"Public_2014-09-01","quotaId":"EnterpriseAgreement_2014-09-01","spendingLimit":"Off"}}' + headers: + cache-control: + - no-cache + content-length: + - '329' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:57:32 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: '{"subscriptionName": "My Big Subscription"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account subscription rename + Connection: + - keep-alive + Content-Length: + - '43' + Content-Type: + - application/json + ParameterSetName: + - --subscription-id --name + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Subscription/rename?api-version=2020-09-01 + response: + body: + string: '{"subscriptionId":"00000000-0000-0000-0000-000000000000"}' + headers: + cache-control: + - no-cache + content-length: + - '57' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:57:38 GMT + expires: + - '-1' + pragma: + - no-cache + request-id: + - 30295d6b-ad3e-45fe-93c5-1b6bcf4460ae + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-gsm: + - 1.0.0.0 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account tenant list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/tenants?api-version=2016-06-01 + response: + body: + string: '{"value":[{"id":"/tenants/e8abe575-baa6-4436-af8a-dbf3eeb3a857","tenantId":"e8abe575-baa6-4436-af8a-dbf3eeb3a857"}]}' + headers: + cache-control: + - no-cache + content-length: + - '116' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:57:39 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: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias000001?api-version=2020-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 19 Oct 2020 04:57:42 GMT + expires: + - '-1' + pragma: + - no-cache + request-id: + - 80a06217-b857-404d-a211-d392a5af14fe + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-gsm: + - 1.0.0.0 + x-ms-ratelimit-remaining-tenant-deletes: + - '14998' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"workload": "Production", "subscriptionId": "00000000-0000-0000-0000-000000000000"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias create + Connection: + - keep-alive + Content-Length: + - '100' + Content-Type: + - application/json + ParameterSetName: + - --name --workload --subscription-id + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"id":"/providers/Microsoft.Subscription/aliases/cli_alias_new000002","name":"cli_alias_new000002","type":"Microsoft.Subscription/aliases","properties":{"subscriptionId":"00000000-0000-0000-0000-000000000000","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '252' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 04:57:47 GMT + expires: + - '-1' + pragma: + - no-cache + request-id: + - 7312f91f-8dd9-4aa7-a4be-fe518944e572 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-gsm: + - 1.0.0.0 + x-ms-ratelimit-remaining-tenant-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:07:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:10:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:13:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:16:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:19:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:22:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:25:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:28:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - account alias delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 + response: + body: + string: '{"error":{"code":"AuthorizationFailed","message":"The client ''kurtangle@aceeatest.onmicrosoft.com'' + with object id ''ffe20297-4fc8-4fb8-8644-667dd932a959'' does not have authorization + to perform action ''Microsoft.Subscription/aliases/delete'' over scope ''/providers/Microsoft.Subscription/aliases/cli_alias_new000002'' + or the scope is invalid. If access was recently granted, please refresh your + credentials."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '411' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 19 Oct 2020 05:31:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 403 + message: Forbidden - request: body: null headers: @@ -849,7 +1832,7 @@ interactions: ParameterSetName: - -n User-Agent: - - AZURECLI/2.11.1 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) + - AZURECLI/2.13.0 azsdk-python-subscriptionclient/unknown Python/3.6.8 (Windows-10-10.0.19041-SP0) method: DELETE uri: https://management.azure.com/providers/Microsoft.Subscription/aliases/cli_alias_new000002?api-version=2020-09-01 response: @@ -861,13 +1844,13 @@ interactions: content-length: - '0' date: - - Wed, 09 Sep 2020 06:44:43 GMT + - Mon, 19 Oct 2020 05:34:55 GMT expires: - '-1' pragma: - no-cache request-id: - - a039b443-376d-474b-8433-c7f5c7ba4a76 + - 6918c286-5903-49a6-8ee9-9f55b1f9ba46 server: - Microsoft-IIS/10.0 strict-transport-security: diff --git a/src/account/azext_account/tests/latest/test_account_scenario.py b/src/account/azext_account/tests/latest/test_account_scenario.py index f00a99d5c5b..78782e18d1c 100644 --- a/src/account/azext_account/tests/latest/test_account_scenario.py +++ b/src/account/azext_account/tests/latest/test_account_scenario.py @@ -23,10 +23,11 @@ def test_account(self): 'new_alias_name': self.create_random_name(prefix='cli_alias_new', length=24), 'display_name': "My Subscription", 'new_display_name': "My Big Subscription", - 'billing_scope': "/providers/Microsoft.Billing/billingAccounts/9147924/enrollmentAccounts/253727" + 'billing_scope': "/providers/Microsoft.Billing/billingAccounts/9147924/enrollmentAccounts/253727", + 'reseller_id': "5139005" }) - self.cmd('az account alias create --name {alias_name} --billing-scope "{billing_scope}" --display-name "{display_name}" --workload "Production"', + self.cmd('az account alias create --name {alias_name} --billing-scope "{billing_scope}" --display-name "{display_name}" --workload "Production" --reseller-id {reseller_id}', checks=[self.check('name', '{alias_name}'), self.check('properties.provisioningState', 'Succeeded')]) @@ -36,9 +37,8 @@ def test_account(self): sub_id = alias_sub['properties']['subscriptionId'] self.kwargs.update({'subscription_id': sub_id}) - # response different from swagger, causing deserialization error - # self.cmd('az account alias list', - # checks=[]) + self.cmd('az account alias list', + checks=[self.exists('value')]) self.cmd('az account subscription list', checks=[self.greater_than('length(@)', 0)]) @@ -54,18 +54,24 @@ def test_account(self): self.cmd('az account subscription cancel --subscription-id {subscription_id} --yes', checks=[self.check('subscriptionId', '{subscription_id}')]) time.sleep(300) - self.cmd('az account subscription show --subscription-id {subscription_id}', - checks=[self.check('displayName', '{display_name}'), - self.check('state', 'Warned'), - self.check('subscriptionId', sub_id)]) + for i in range(5): + sub = self.cmd('az account subscription show --subscription-id {subscription_id}', + checks=[self.check('displayName', '{display_name}'), + self.check('subscriptionId', sub_id)]).get_output_in_json() + if sub['state'] != 'Warned': + time.sleep(180) + self.assertEquals(sub['state'], 'Warned') self.cmd('az account subscription enable --subscription-id {subscription_id}', checks=[self.check('subscriptionId', '{subscription_id}')]) time.sleep(300) - self.cmd('az account subscription show --subscription-id {subscription_id}', - checks=[self.check('displayName', '{display_name}'), - self.check('state', 'Enabled'), - self.check('subscriptionId', sub_id)]) + for i in range(10): + sub = self.cmd('az account subscription show --subscription-id {subscription_id}', + checks=[self.check('displayName', '{display_name}'), + self.check('subscriptionId', sub_id)]).get_output_in_json() + if sub['state'] != 'Enabled': + time.sleep(180) + self.assertEquals(sub['state'], 'Enabled') self.cmd('az account subscription rename --subscription-id {subscription_id} --name "{new_display_name}"', checks=[self.check('subscriptionId', '{subscription_id}')]) @@ -88,5 +94,11 @@ def test_account(self): self.check('properties.provisioningState', 'Succeeded')]) time.sleep(600) - self.cmd('az account alias delete -n {new_alias_name}', - checks=[]) + for i in range(10): + try: + self.cmd('az account alias delete -n {new_alias_name}', checks=[]) + break + except Exception as ex: + if i == 9: + raise ex + time.sleep(180) diff --git a/src/account/azext_account/vendored_sdks/subscription/models/_models.py b/src/account/azext_account/vendored_sdks/subscription/models/_models.py index 5987788aaf3..9c37458d737 100644 --- a/src/account/azext_account/vendored_sdks/subscription/models/_models.py +++ b/src/account/azext_account/vendored_sdks/subscription/models/_models.py @@ -316,6 +316,8 @@ class PutAliasRequestProperties(msrest.serialization.Model): :param subscription_id: This parameter can be used to create alias for existing subscription Id. :type subscription_id: str + :param reseller_id: Reseller ID, basically MPN Id. + :type reseller_id: str """ _attribute_map = { @@ -323,6 +325,7 @@ class PutAliasRequestProperties(msrest.serialization.Model): 'workload': {'key': 'workload', 'type': 'str'}, 'billing_scope': {'key': 'billingScope', 'type': 'str'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'reseller_id': {'key': 'resellerId', 'type': 'str'}, } def __init__( @@ -330,10 +333,11 @@ def __init__( **kwargs ): super(PutAliasRequestProperties, self).__init__(**kwargs) - self.display_name = kwargs['display_name'] - self.workload = kwargs['workload'] - self.billing_scope = kwargs['billing_scope'] + self.display_name = kwargs.get('display_name', None) + self.workload = kwargs.get('workload', None) + self.billing_scope = kwargs.get('billing_scope', None) self.subscription_id = kwargs.get('subscription_id', None) + self.reseller_id = kwargs.get('reseller_id', None) class PutAliasResponse(msrest.serialization.Model): diff --git a/src/account/azext_account/vendored_sdks/subscription/models/_models_py3.py b/src/account/azext_account/vendored_sdks/subscription/models/_models_py3.py index 5f0dee7a2cb..7453e60d805 100644 --- a/src/account/azext_account/vendored_sdks/subscription/models/_models_py3.py +++ b/src/account/azext_account/vendored_sdks/subscription/models/_models_py3.py @@ -339,6 +339,8 @@ class PutAliasRequestProperties(msrest.serialization.Model): :param subscription_id: This parameter can be used to create alias for existing subscription Id. :type subscription_id: str + :param reseller_id: Reseller ID, basically MPN Id. + :type reseller_id: str """ _attribute_map = { @@ -346,15 +348,17 @@ class PutAliasRequestProperties(msrest.serialization.Model): 'workload': {'key': 'workload', 'type': 'str'}, 'billing_scope': {'key': 'billingScope', 'type': 'str'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, + 'reseller_id': {'key': 'resellerId', 'type': 'str'}, } def __init__( self, *, - display_name: str, - workload: Union[str, "Workload"], - billing_scope: str, + display_name: Optional[str] = None, + workload: Optional[Union[str, "Workload"]] = None, + billing_scope: Optional[str] = None, subscription_id: Optional[str] = None, + reseller_id: Optional[str] = None, **kwargs ): super(PutAliasRequestProperties, self).__init__(**kwargs) @@ -362,6 +366,7 @@ def __init__( self.workload = workload self.billing_scope = billing_scope self.subscription_id = subscription_id + self.reseller_id = reseller_id class PutAliasResponse(msrest.serialization.Model): diff --git a/src/account/setup.cfg b/src/account/setup.cfg index 3c6e79cf31d..e69de29bb2d 100644 --- a/src/account/setup.cfg +++ b/src/account/setup.cfg @@ -1,2 +0,0 @@ -[bdist_wheel] -universal=1 diff --git a/src/account/setup.py b/src/account/setup.py index 721b72f13be..76f518859ef 100644 --- a/src/account/setup.py +++ b/src/account/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.2.0' +VERSION = '0.2.1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -47,8 +47,7 @@ # TODO: Update author and email, if applicable author='Microsoft Corporation', author_email='azpycli@microsoft.com', - # TODO: consider pointing directly to your source code instead of the generic repo - url='https://github.com/Azure/azure-cli-extensions', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/account', long_description=README + '\n\n' + HISTORY, license='MIT', classifiers=CLASSIFIERS,