commands: group deployment validate & export (#464)

This commit is contained in:
Yugang Wang 2016-06-29 11:36:04 -07:00 коммит произвёл GitHub
Родитель e25b9227a1
Коммит 95590e7a0f
7 изменённых файлов: 459 добавлений и 7 удалений

Просмотреть файл

@ -523,6 +523,8 @@
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_lb\nested_templates\publicIp_none_or_existing.json" />
<Content Include="command_modules\azure-cli-network\requirements.txt" />
<Content Include="command_modules\azure-cli-profile\requirements.txt" />
<Content Include="command_modules\azure-cli-resource\azure\cli\command_modules\resource\tests\arm_deploy_parameters.json" />
<Content Include="command_modules\azure-cli-resource\azure\cli\command_modules\resource\tests\simple_deploy.json" />
<Content Include="command_modules\azure-cli-resource\requirements.txt" />
<Content Include="command_modules\azure-cli-role\azure\cli\command_modules\role\tests\recordings\expected_results.res" />
<Content Include="command_modules\azure-cli-role\azure\cli\command_modules\role\tests\recordings\test_role_assignment_scenario.yaml" />

Просмотреть файл

@ -6,6 +6,7 @@ import time
from codecs import open as codecs_open
from msrestazure.azure_exceptions import CloudError
from azure.mgmt.resource.resources import ResourceManagementClient
from azure.mgmt.resource.resources.models.resource_group import ResourceGroup
from azure.mgmt.resource.resources.models import GenericResource
@ -143,7 +144,23 @@ def deploy_arm_template(
:param str template_file_path:path to deployment template JSON file
:param str parameters_file_path:path to deployment parameters JSON file
'''
from azure.mgmt.resource.resources import ResourceManagementClient
return _deploy_arm_template_core(resource_group_name, deployment_name, template_file_path,
parameters_file_path, mode)
def validate_arm_template(resource_group_name, template_file_path,
parameters_file_path, mode='incremental'):
''' Validate an ARM template.
:param str resource_group_name:resource group for deployment
:param str location:location for deployment
(use different values for simultaneous deployments)
:param str template_file_path:path to deployment template JSON file
:param str parameters_file_path:path to deployment parameters JSON file
'''
return _deploy_arm_template_core(resource_group_name, 'deployment_dry_run', template_file_path,
parameters_file_path, mode, validate_only=True)
def _deploy_arm_template_core(resource_group_name, deployment_name, template_file_path,
parameters_file_path, mode, validate_only=False):
from azure.mgmt.resource.resources.models import DeploymentProperties
parameters = _get_file_json(parameters_file_path)
@ -154,7 +171,15 @@ def deploy_arm_template(
properties = DeploymentProperties(template=template, parameters=parameters, mode=mode)
smc = get_mgmt_service_client(ResourceManagementClient)
return smc.deployments.create_or_update(resource_group_name, deployment_name, properties)
if validate_only:
return smc.deployments.validate(resource_group_name, deployment_name, properties)
else:
return smc.deployments.create_or_update(resource_group_name, deployment_name, properties)
def export_deployment_as_template(resource_group_name, deployment_name):
smc = get_mgmt_service_client(ResourceManagementClient)
result = smc.deployments.export_template(resource_group_name, deployment_name)
print(json.dumps(result.template, indent=2))#pylint: disable=no-member
def tag_resource(
resource_group_name, resource_name, resource_type, tags, parent_resource_path=None,

Просмотреть файл

@ -12,7 +12,7 @@ from azure.cli.commands import cli_command
from azure.cli.command_modules.resource._factory import _resource_client_factory
from azure.cli.command_modules.resource.custom import (
list_resource_groups, create_resource_group, export_group_as_template, list_resources,
deploy_arm_template, tag_resource,
deploy_arm_template, validate_arm_template, tag_resource, export_deployment_as_template,
register_provider, unregister_provider
)
@ -40,7 +40,6 @@ cli_command('resource provider show', ProvidersOperations.get, factory)
cli_command('resource provider register', register_provider)
cli_command('resource provider unregister', unregister_provider)
# Tag commands
factory = lambda _: _resource_client_factory().tags
cli_command('tag list', TagsOperations.list, factory)
@ -54,8 +53,9 @@ factory = lambda _: _resource_client_factory().deployments
cli_command('resource group deployment create', deploy_arm_template)
cli_command('resource group deployment list', DeploymentsOperations.list, factory)
cli_command('resource group deployment show', DeploymentsOperations.get, factory)
cli_command('resource group deployment validate', DeploymentsOperations.validate, factory)
cli_command('resource group deployment validate', validate_arm_template)
cli_command('resource group deployment exists', DeploymentsOperations.check_existence, factory)
cli_command('resource group deployment export', export_deployment_as_template)
# Resource group deployment operations commands
factory = lambda _: _resource_client_factory().deployment_operations

Просмотреть файл

@ -0,0 +1,344 @@
interactions:
- request:
body: !!binary |
eyJwcm9wZXJ0aWVzIjogeyJwYXJhbWV0ZXJzIj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VlX25hbWUiOiJhZG1pbjNAQXp1cmVTREtUZWFtLm9ubWljcm9zb2Z0LmNvbSIsInVwbiI6ImFkbWluM0BBenVyZVNES1RlYW0ub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIiwid2lkcyI6WyI2MmU5MDM5NC02OWY1LTQyMzctOTE5MC0wMTIxNzcxNDVlMTAiXX0.WFYKu0Mc-ek0d7KpBvMXUo-iMl22kzHnnd1LYSQHWOjsaQLG6FsJ4T-h0uSh2FUoRoscXGXFn1oO-SN05HRF_ud-upGli8BndAYw9ZISza4mXieyUbT5metqppTgWx44JkYwHxBqpNppELihzd5_IlVJZwLybit-fafAqKwPBDMvNvCG0YZp-MhuSu8kRdXAtz7lQk3DsV0gty75x5Tj_kAQCa9hq5VzOyMMuanJFT1JL2klJxlOzw9fYLjIewa3Pra6YquVraSBK3aY4TDVm25vBQrJ3pe3H9dEPgmQPH6BBVli266uvSgnIaiY6_b6X_LzNe2l1gk2bSlSp1t4jA]
Connection: [keep-alive]
Content-Length: ['863']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 (Windows-10.0.10586) requests/2.9.1 msrest/0.4.0 msrest_azure/0.4.1
resourcemanagementclient/2016-02-01 Azure-SDK-For-Python AZURECLI/TEST/0.0.32]
accept-language: [en-US]
x-ms-client-request-id: [855a60cc-3d6c-11e6-a937-64510658e3b3]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2016-02-01
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR8Xs
o0cf3W3Wk2ZaF6u2qJbN3Z3J7vmn+w92t3cn5zvb+7NZtp3l03vb08nDvQd75zsP7z/cuVvnTbWu
p/nndbVeNXezH6zrfHtaFtuzfFVW14t82W63edPeXdXVZTHL6+buF8W0rprqvB2/0pebu661//vv
P6uvf/96vfxo9NEyW+SEYvQ7Ar3K67bIm48e/eKPVllNbVvqCX/Je7/4o/Z6RT8/et3WxfKC3rnM
yjU+6CLMyG4vm4vdj37J6KOymmYgxiYIV/TCuvnol1DzRTXDJ2fLaZ0Dx6ykdoTdZdEQEHrtdZu1
aHE8nearNp/R122xIADZYkUf7+3sfrq98+n23sGbvZ1Hu7uP7h2MH+7s7z/c/fSnqOlsXSs2H718
s/OaPplWdZ2X/OEZZjDP783uP8jz7Wxy/mB7f3c33364d+98eyffyw8O9vc+vXcvo9cYJczFR4++
JyRqVtkUiLm5eZG3V1X9llqbKX5DBJA3/E/opaU0fZ1P13XRXgsr0IuGenjJkOn7v4T+o6Hkq3w5
y5dTnrTv0SdEzmJG1JlZpqDPf/FH2ar4SUKUoFBHRJ/7oM/ufYL+c8OySpa70TH3YDEc4SbLwhvb
KJPdsj96wdCYXlIK8/R68tDoK6/WJT743vd/CU3BL/l/APzVoGrzAwAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Length: ['612']
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 28 Jun 2016 20:11:38 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 200, message: OK}
- request:
body: !!binary |
eyJwcm9wZXJ0aWVzIjogeyJwYXJhbWV0ZXJzIjogeyJuYW1lIjogeyJ2YWx1ZSI6ICJhenVyZS1j
bGktZGVwbG95LXRlc3QtbnNnMSJ9LCAibG9jYXRpb24iOiB7InZhbHVlIjogIndlc3R1cyJ9fSwg
InRlbXBsYXRlIjogeyJ2YXJpYWJsZXMiOiB7fSwgImNvbnRlbnRWZXJzaW9uIjogIjEuMC4wLjAi
LCAib3V0cHV0cyI6IHsiTmV3TlNHIjogeyJ2YWx1ZSI6ICJbcmVmZXJlbmNlKHBhcmFtZXRlcnMo
J25hbWUnKSldIiwgInR5cGUiOiAib2JqZWN0In19LCAiJHNjaGVtYSI6ICJodHRwczovL3NjaGVt
YS5tYW5hZ2VtZW50LmF6dXJlLmNvbS9zY2hlbWFzLzIwMTUtMDEtMDEvZGVwbG95bWVudFRlbXBs
YXRlLmpzb24jIiwgInJlc291cmNlcyI6IFt7InByb3BlcnRpZXMiOiB7InNlY3VyaXR5UnVsZXMi
OiBbXX0sICJ0eXBlIjogIk1pY3Jvc29mdC5OZXR3b3JrL25ldHdvcmtTZWN1cml0eUdyb3VwcyIs
ICJuYW1lIjogIltwYXJhbWV0ZXJzKCduYW1lJyldIiwgImFwaVZlcnNpb24iOiAiMjAxNS0wNi0x
NSIsICJkZXBlbmRzT24iOiBbXSwgImxvY2F0aW9uIjogIltwYXJhbWV0ZXJzKCdsb2NhdGlvbicp
XSJ9XSwgInBhcmFtZXRlcnMiOiB7Im5hbWUiOiB7InR5cGUiOiAic3RyaW5nIiwgIm1ldGFkYXRh
IjogeyJkZXNjcmlwdGlvbiI6ICJOYW1lIG9mIHRoZSBuZXR3b3JrIHNlY3VyaXR5IGdyb3VwLiJ9
fSwgImxvY2F0aW9uIjogeyJkZWZhdWx0VmFsdWUiOiAiW3Jlc291cmNlR3JvdXAoKS5sb2NhdGlv
bl0iLCAidHlwZSI6ICJzdHJpbmciLCAibWV0YWRhdGEiOiB7ImRlc2NyaXB0aW9uIjogIkxvY2F0
aW9uIGZvciB0aGUgbmV0d29yayBzZWN1cml0eSBncm91cC4ifX19fSwgIm1vZGUiOiAiSW5jcmVt
ZW50YWwifX0=
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Authorization: [Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyIsImtpZCI6IlliUkFRUlljRV9tb3RXVkp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d7KpBvMXUo-iMl22kzHnnd1LYSQHWOjsaQLG6FsJ4T-h0uSh2FUoRoscXGXFn1oO-SN05HRF_ud-upGli8BndAYw9ZISza4mXieyUbT5metqppTgWx44JkYwHxBqpNppELihzd5_IlVJZwLybit-fafAqKwPBDMvNvCG0YZp-MhuSu8kRdXAtz7lQk3DsV0gty75x5Tj_kAQCa9hq5VzOyMMuanJFT1JL2klJxlOzw9fYLjIewa3Pra6YquVraSBK3aY4TDVm25vBQrJ3pe3H9dEPgmQPH6BBVli266uvSgnIaiY6_b6X_LzNe2l1gk2bSlSp1t4jA]
Connection: [keep-alive]
Content-Length: ['863']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 (Windows-10.0.10586) requests/2.9.1 msrest/0.4.0 msrest_azure/0.4.1
resourcemanagementclient/2016-02-01 Azure-SDK-For-Python AZURECLI/TEST/0.0.32]
accept-language: [en-US]
x-ms-client-request-id: [86ba0e7e-3d6c-11e6-b9f1-64510658e3b3]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2016-02-01
response:
body: {string: '{"id":"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/azure-cli-deployment","name":"azure-cli-deployment","properties":{"parameters":{"name":{"type":"String","value":"azure-cli-deploy-test-nsg1"},"location":{"type":"String","value":"westus"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2016-06-28T20:11:41.8616785Z","duration":"PT0.712335S","correlationId":"3ebca52d-e8ee-46bd-91a6-b701b82bc9b5","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"networkSecurityGroups","locations":["westus"]}]}],"dependencies":[]}}'}
headers:
Azure-AsyncOperation: ['https://management.azure.com/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/azure-cli-deployment/operationStatuses/08587344621843282882?api-version=2016-02-01']
Cache-Control: [no-cache]
Content-Length: ['655']
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 28 Jun 2016 20:11:42 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 201, message: Created}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Authorization: [Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyIsImtpZCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWF0IjoxNDY3MTQzODkwLCJuYmYiOjE0NjcxNDM4OTAsImV4cCI6MTQ2NzE0Nzc5MCwiYWNyIjoiMSIsImFtciI6WyJwd2QiXSwiYXBwaWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJhcHBpZGFjciI6IjAiLCJmYW1pbHlfbmFtZSI6InNkayIsImdpdmVuX25hbWUiOiJhZG1pbjMiLCJncm91cHMiOlsiZTRiYjBiNTYtMTAxNC00MGY4LTg4YWItM2Q4YThjYjBlMDg2IiwiNmI5Nzc2MWEtZDdkMC00OGY2LWFkNTYtZjM4ZDMyN2M4NTUzIl0sImlwYWRkciI6IjE2Ny4yMjAuMS4xMzAiLCJuYW1lIjoiYWRtaW4zIiwib2lkIjoiZTdlMTU4ZDMtN2NkYy00N2NkLTg4MjUtNTg1OWQ3YWIyYjU1IiwicHVpZCI6IjEwMDMzRkZGOTVENDRFODQiLCJzY3AiOiJ1c2VyX2ltcGVyc29uYXRpb24iLCJzdWIiOiJoUXp5d29xUy1BLUcwMkk5emROU0ZrRnd0djBlcGdpVmNVbHZtT2RGR2hRIiwidGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIiwidW5pcXVlX25hbWUiOiJhZG1pbjNAQXp1cmVTREtUZWFtLm9ubWljcm9zb2Z0LmNvbSIsInVwbiI6ImFkbWluM0BBenVyZVNES1RlYW0ub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIiwid2lkcyI6WyI2MmU5MDM5NC02OWY1LTQyMzctOTE5MC0wMTIxNzcxNDVlMTAiXX0.WFYKu0Mc-ek0d7KpBvMXUo-iMl22kzHnnd1LYSQHWOjsaQLG6FsJ4T-h0uSh2FUoRoscXGXFn1oO-SN05HRF_ud-upGli8BndAYw9ZISza4mXieyUbT5metqppTgWx44JkYwHxBqpNppELihzd5_IlVJZwLybit-fafAqKwPBDMvNvCG0YZp-MhuSu8kRdXAtz7lQk3DsV0gty75x5Tj_kAQCa9hq5VzOyMMuanJFT1JL2klJxlOzw9fYLjIewa3Pra6YquVraSBK3aY4TDVm25vBQrJ3pe3H9dEPgmQPH6BBVli266uvSgnIaiY6_b6X_LzNe2l1gk2bSlSp1t4jA]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 (Windows-10.0.10586) requests/2.9.1 msrest/0.4.0 msrest_azure/0.4.1
resourcemanagementclient/2016-02-01 Azure-SDK-For-Python AZURECLI/TEST/0.0.32]
accept-language: [en-US]
x-ms-client-request-id: [86ba0e7e-3d6c-11e6-b9f1-64510658e3b3]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08587344621843282882?api-version=2016-02-01
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR02b
tevmo0cfvV5Pp3k+y2cf/ZL/ByCIe+QWAAAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Length: ['141']
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 28 Jun 2016 20:12:11 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Authorization: [Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyIsImtpZCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWF0IjoxNDY3MTQzODkwLCJuYmYiOjE0NjcxNDM4OTAsImV4cCI6MTQ2NzE0Nzc5MCwiYWNyIjoiMSIsImFtciI6WyJwd2QiXSwiYXBwaWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJhcHBpZGFjciI6IjAiLCJmYW1pbHlfbmFtZSI6InNkayIsImdpdmVuX25hbWUiOiJhZG1pbjMiLCJncm91cHMiOlsiZTRiYjBiNTYtMTAxNC00MGY4LTg4YWItM2Q4YThjYjBlMDg2IiwiNmI5Nzc2MWEtZDdkMC00OGY2LWFkNTYtZjM4ZDMyN2M4NTUzIl0sImlwYWRkciI6IjE2Ny4yMjAuMS4xMzAiLCJuYW1lIjoiYWRtaW4zIiwib2lkIjoiZTdlMTU4ZDMtN2NkYy00N2NkLTg4MjUtNTg1OWQ3YWIyYjU1IiwicHVpZCI6IjEwMDMzRkZGOTVENDRFODQiLCJzY3AiOiJ1c2VyX2ltcGVyc29uYXRpb24iLCJzdWIiOiJoUXp5d29xUy1BLUcwMkk5emROU0ZrRnd0djBlcGdpVmNVbHZtT2RGR2hRIiwidGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIiwidW5pcXVlX25hbWUiOiJhZG1pbjNAQXp1cmVTREtUZWFtLm9ubWljcm9zb2Z0LmNvbSIsInVwbiI6ImFkbWluM0BBenVyZVNES1RlYW0ub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIiwid2lkcyI6WyI2MmU5MDM5NC02OWY1LTQyMzctOTE5MC0wMTIxNzcxNDVlMTAiXX0.WFYKu0Mc-ek0d7KpBvMXUo-iMl22kzHnnd1LYSQHWOjsaQLG6FsJ4T-h0uSh2FUoRoscXGXFn1oO-SN05HRF_ud-upGli8BndAYw9ZISza4mXieyUbT5metqppTgWx44JkYwHxBqpNppELihzd5_IlVJZwLybit-fafAqKwPBDMvNvCG0YZp-MhuSu8kRdXAtz7lQk3DsV0gty75x5Tj_kAQCa9hq5VzOyMMuanJFT1JL2klJxlOzw9fYLjIewa3Pra6YquVraSBK3aY4TDVm25vBQrJ3pe3H9dEPgmQPH6BBVli266uvSgnIaiY6_b6X_LzNe2l1gk2bSlSp1t4jA]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 (Windows-10.0.10586) requests/2.9.1 msrest/0.4.0 msrest_azure/0.4.1
resourcemanagementclient/2016-02-01 Azure-SDK-For-Python AZURECLI/TEST/0.0.32]
accept-language: [en-US]
x-ms-client-request-id: [86ba0e7e-3d6c-11e6-b9f1-64510658e3b3]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2016-02-01
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR8Xs
o0cf3W3Wk2ZaF6u2qJbN3Z3J7vmn+w92t3cn5zvb+7NZtp3l03vb08nDvQd75zsP7z/cuVvnTbWu
p/nndbVeNXezH6zrfHtaFtuzfFVW14t82W63edPeXdXVZTHL6+buF8W0rprqvB2/0pebu651HMZH
o4+W2SInJAe+JfCrvG6LvPno0S/+aJXV1Lql3vCXvPmLP2qvV/Tzo9dtXSwv6J3LrFzjgy5IRnh7
2VzsfvRLRh+V1TQDQTZBuKIX1s1Hv4SaL6oZPjlbTuscuGUltSPsLouGgNBrr9usRYvX6+k0z2f5
jL5viwVByBYr+nxvZ/fT7Z1Pt/cO3uztPNrdfXT//vjg4b39Tx/s/RQ1na1rReejl29298cP9vd3
9+49eE1fTau6zkv+9gzzeS+fTLP7e7Pt/CDPt/c/ncy2H+5mn25PHuzsTg72JtOHk/v0GiOHmfno
0feEWM0qmwJFN1Mv8vaqqt9SazPhb4gU8ob/Cb20lKav8+m6LtprYQx60dARLxmCff+X0H80pnyV
L2f5csrT9z36pFq3q3VLfxBC+dWL15/jN6X+l5OfzqeYc6U+TTdGsIG8BsPP18znxMn3z/MH0+3d
KRFn/3xnuj2Z3icW//TeQ/rr4GBvuktvNTqCV+vSoDXLz7N12ZqxmW8IyQws9tFxWVZXP0kUOFs+
qdZL9M093v1hS5bO111CBT8NwgOwGA4zPAlif4R3I8PK2+yCBvbdu7/vR/v3Pt05uJ/PtrPzAxrN
/vnD7YPs/v3tB5OH09nObH9v78Hk9/2I3iFEfRkF2hsmbZZbitE3jEJaLCfoP23r7Py8mKbndbVI
s7JMf/KLhr5Mf/LF6Rt6lUC31bQq6b1v0Z9Cx5dV3b7KlhfoB58S/LZYMkt2v5IXjmczmoPmZZ2f
F+/om58s6nadlUpaauZBuLFtRgNraNwyEPpgVRcVKPzRo0/v7+zsELSiJrYmWNToTMYJhRLy1jFm
7nmVzZ5kZbac5rWbkf/fMNqGMf6/ieuAZVoSmulE8aTXCfzPAuf1KEItPSDd5gB0A7/tEoAb+O1p
vrymlx3x///AYL1B/bA5CgiwxiqE5IapqCEB+lngHXzjvRT72vIKkKO/fVYhXqH3b2AVoqjYhy/X
rSHs/x+4JTauHzbDMA4p+UNMdsMuqoOIj2D52sr++v8jI0hE5zH3We1sSa59OC3/v2G3yNj+X8py
BlN6n+D/LPAavvFe6n7t9X8DY3WsHZGWRxYwFnQfvU3fGbL//4Gl+qP6YTMTMGCu6fITtSRIP3y2
wdeWX4Ad/e2zC/ELvR9nl+//EmKZj2gkFJza5AUHgMwsHz6LH6GL/wfwZ7/EjxEAAA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Length: ['1132']
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 28 Jun 2016 20:12:13 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Authorization: [Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyIsImtpZCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWF0IjoxNDY3MTQzODkwLCJuYmYiOjE0Njcx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uanJFT1JL2klJxlOzw9fYLjIewa3Pra6YquVraSBK3aY4TDVm25vBQrJ3pe3H9dEPgmQPH6BBVli266uvSgnIaiY6_b6X_LzNe2l1gk2bSlSp1t4jA]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 (Windows-10.0.10586) requests/2.9.1 msrest/0.4.0 msrest_azure/0.4.1
resourcemanagementclient/2016-02-01 Azure-SDK-For-Python AZURECLI/TEST/0.0.32]
accept-language: [en-US]
x-ms-client-request-id: [ac9f2c14-3d6c-11e6-b10f-64510658e3b3]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/?api-version=2016-02-01
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR5dZ
uc4/evS9X/xRMfvo0Ud3m/WkmdbFqi2qZXN3Z7J7/un+g93t3cn5zvb+bJZtZ/n03vZ08nDvwd75
zsP7D3fu1nlTretp/nldrVfN3ewH6zrfnpbF9ixfldX1Il+2223etHdXdXVZzPK6uftFMa2rpjpv
x6/05eauax2H8dHoo2W2IFw/GviWwK/yui3y5qNHv/ijVVZT65Z6w1/y5i/+qL1e0c+PXrd1sbyg
d3T4PZCM8Payudj96JeMPiqraQaCbIJwRS+sm49+CTVfVDN8crac1jlwy0pqR9hdFg0Boddet1mL
Fq/X02mez/IZfd8WC4KQLVb0+d7O7qfbO59u7x282dt5tLv76P798cHDe/ufPtj7KWo6W9eKzkcv
3+zujx/s7+/u3Xvwmr6aVnWdl/ztGebzXj6ZZvf3Ztv5QZ5v7386mW0/3M0+3Z482NmdHOxNpg8n
9+k1Rg4zw5wAYjWrbAoU3Uy9yNurqn5Lrc2EvyFSyBv+J/TSUpq+zqfrumivhTHoRUNHvGQI9v1f
Qv/RmPJVvpzlyylP3/fok2rdrtYt/UEI5VcvXn+O35T6X05+Op9izpX6NN0YwQbyGgw/XzOfEyff
P88fTLd3p0Sc/fOd6fZkep9Y/NN7D+mvg4O96S691egIXq1Lg9YsP8/WZWvGZr4hJDOw2EfHZVld
/SRR4Gz5pFov0Tf3ePeHLVk6X3cJFfw0CA/AYjjM8CSI/RHejQwrb7MLGth37/6+H+3f+3Tn4H4+
287OD2g0++cPtw+y+/e3H0weTmc7s/29vQeT3/cjeocQ9WUUaG+YtFluKUbfMAppsZyg/7Sts/Pz
Ypqe19Uizcoy/ckvGvoy/ckXp2/oVQLdVtOqpPe+RX8KHV9WdfsqW16gH3xK8NtiySzZ/UpeOJ7N
aA6al3V+Xryjb36yqNt1VippqZkH4ca2GQ2soXHLQOiDVV1UoPBHjz69v7OzQ9CKmtiaYFGjMxkn
FErIW8eYuedVNnuSldlymtduRv5/w2gbxvj/Jq4DlmlJaKYTxZNeJ/A/C5zXowi19IB0mwPQDfy2
SwBu4Len+fKaXnbE//8Dg/UG9cPmKCDAGqsQkhumooYE6GeBd/CN91Lsa8srQI7+9lmFeIXev4FV
iKJiH75ct4aw/3/glti4ftgMwzik5A8x2Q27qA4iPoLlayv76/+PjCARncfcZ7WzJbn24bT8/4bd
ImP7fynLGUzpfYL/s8Br+MZ7qfu11/8NjNWxdkRaHlnAWNB99DZ9Z8j+/weW6o/qh81MwIC5pstP
1JIg/fDZBl9bfgF29LfPLsQv9H6cXb7/S4hlPqKRUHBqkxccADKzfPgsfoQuvv9L/h+pMKUBmxEA
AA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Length: ['1141']
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 28 Jun 2016 20:12:43 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application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sInVwbiI6ImFkbWluM0BBenVyZVNES1RlYW0ub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIiwid2lkcyI6WyI2MmU5MDM5NC02OWY1LTQyMzctOTE5MC0wMTIxNzcxNDVlMTAiXX0.WFYKu0Mc-ek0d7KpBvMXUo-iMl22kzHnnd1LYSQHWOjsaQLG6FsJ4T-h0uSh2FUoRoscXGXFn1oO-SN05HRF_ud-upGli8BndAYw9ZISza4mXieyUbT5metqppTgWx44JkYwHxBqpNppELihzd5_IlVJZwLybit-fafAqKwPBDMvNvCG0YZp-MhuSu8kRdXAtz7lQk3DsV0gty75x5Tj_kAQCa9hq5VzOyMMuanJFT1JL2klJxlOzw9fYLjIewa3Pra6YquVraSBK3aY4TDVm25vBQrJ3pe3H9dEPgmQPH6BBVli266uvSgnIaiY6_b6X_LzNe2l1gk2bSlSp1t4jA]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 (Windows-10.0.10586) requests/2.9.1 msrest/0.4.0 msrest_azure/0.4.1
resourcemanagementclient/2016-02-01 Azure-SDK-For-Python AZURECLI/TEST/0.0.32]
accept-language: [en-US]
x-ms-client-request-id: [b690b39c-3d6c-11e6-b5b2-64510658e3b3]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2016-02-01
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR8Xs
o0cf3W3Wk2ZaF6u2qJbN3Z3J7vmn+w92t3cn5zvb+7NZtp3l03vb08nDvQd75zsP7z/cuVvnTbWu
p/nndbVeNXezH6zrfHtaFtuzfFVW14t82W63edPeXdXVZTHL6+buF8W0rprqvB2/0pebu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X8py
BlN6n+D/LPAavvFe6n7t9X8DY3WsHZGWRxYwFnQfvU3fGbL//4Gl+qP6YTMTMGCu6fITtSRIP3y2
wdeWX4Ad/e2zC/ELvR9nl+//EmKZj2gkFJza5AUHgMwsHz6LH6GL/wfwZ7/EjxEAAA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Length: ['1132']
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 28 Jun 2016 20:13:00 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Authorization: [Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyIsImtpZCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWF0IjoxNDY3MTQzODkwLCJuYmYiOjE0NjcxNDM4OTAsImV4cCI6MTQ2NzE0Nzc5MCwiYWNyIjoiMSIsImFtciI6WyJwd2QiXSwiYXBwaWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJhcHBpZGFjciI6IjAiLCJmYW1pbHlfbmFtZSI6InNkayIsImdpdmVuX25hbWUiOiJhZG1pbjMiLCJncm91cHMiOlsiZTRiYjBiNTYtMTAxNC00MGY4LTg4YWItM2Q4YThjYjBlMDg2IiwiNmI5Nzc2MWEtZDdkMC00OGY2LWFkNTYtZjM4ZDMyN2M4NTUzIl0sImlwYWRkciI6IjE2Ny4yMjAuMS4xMzAiLCJuYW1lIjoiYWRtaW4zIiwib2lkIjoiZTdlMTU4ZDMtN2NkYy00N2NkLTg4MjUtNTg1OWQ3YWIyYjU1IiwicHVpZCI6IjEwMDMzRkZGOTVENDRFODQiLCJzY3AiOiJ1c2VyX2ltcGVyc29uYXRpb24iLCJzdWIiOiJoUXp5d29xUy1BLUcwMkk5emROU0ZrRnd0djBlcGdpVmNVbHZtT2RGR2hRIiwidGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIiwidW5pcXVlX25hbWUiOiJhZG1pbjNAQXp1cmVTREtUZWFtLm9ubWljcm9zb2Z0LmNvbSIsInVwbiI6ImFkbWluM0BBenVyZVNES1RlYW0ub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIiwid2lkcyI6WyI2MmU5MDM5NC02OWY1LTQyMzctOTE5MC0wMTIxNzcxNDVlMTAiXX0.WFYKu0Mc-ek0d7KpBvMXUo-iMl22kzHnnd1LYSQHWOjsaQLG6FsJ4T-h0uSh2FUoRoscXGXFn1oO-SN05HRF_ud-upGli8BndAYw9ZISza4mXieyUbT5metqppTgWx44JkYwHxBqpNppELihzd5_IlVJZwLybit-fafAqKwPBDMvNvCG0YZp-MhuSu8kRdXAtz7lQk3DsV0gty75x5Tj_kAQCa9hq5VzOyMMuanJFT1JL2klJxlOzw9fYLjIewa3Pra6YquVraSBK3aY4TDVm25vBQrJ3pe3H9dEPgmQPH6BBVli266uvSgnIaiY6_b6X_LzNe2l1gk2bSlSp1t4jA]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 (Windows-10.0.10586) requests/2.9.1 msrest/0.4.0 msrest_azure/0.4.1
resourcemanagementclient/2016-02-01 Azure-SDK-For-Python AZURECLI/TEST/0.0.32]
accept-language: [en-US]
x-ms-client-request-id: [b9d3bf1e-3d6c-11e6-bf94-64510658e3b3]
method: HEAD
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-deployment-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2016-02-01
response:
body: {string: ''}
headers:
Cache-Control: [no-cache]
Content-Length: ['0']
Date: ['Tue, 28 Jun 2016 20:13:06 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
status: {code: 204, message: No Content}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Authorization: [Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyIsImtpZCI6IlliUkFRUlljRV9tb3RXVkpLSHJ3TEJiZF85cyJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC81NDgyNmIyMi0zOGQ2LTRmYjItYmFkOS1iN2I5M2EzZTljNWEvIiwiaWF0IjoxNDY3MTQzODkwLCJuYmYiOjE0NjcxNDM4OTAsImV4cCI6MTQ2NzE0Nzc5MCwiYWNyIjoiMSIsImFtciI6WyJwd2QiXSwiYXBwaWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJhcHBpZGFjciI6IjAiLCJmYW1pbHlfbmFtZSI6InNkayIsImdpdmVuX25hbWUiOiJhZG1pbjMiLCJncm91cHMiOlsiZTRiYjBiNTYtMTAxNC00MGY4LTg4YWItM2Q4YThjYjBlMDg2IiwiNmI5Nzc2MWEtZDdkMC00OGY2LWFkNTYtZjM4ZDMyN2M4NTUzIl0sImlwYWRkciI6IjE2Ny4yMjAuMS4xMzAiLCJuYW1lIjoiYWRtaW4zIiwib2lkIjoiZTdlMTU4ZDMtN2NkYy00N2NkLTg4MjUtNTg1OWQ3YWIyYjU1IiwicHVpZCI6IjEwMDMzRkZGOTVENDRFODQiLCJzY3AiOiJ1c2VyX2ltcGVyc29uYXRpb24iLCJzdWIiOiJoUXp5d29xUy1BLUcwMkk5emROU0ZrRnd0djBlcGdpVmNVbHZtT2RGR2hRIiwidGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIiwidW5pcXVlX25hbWUiOiJhZG1pbjNAQXp1cmVTREtUZWFtLm9ubWljcm9zb2Z0LmNvbSIsInVwbiI6ImFkbWluM0BBenVyZVNES1RlYW0ub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIiwid2lkcyI6WyI2MmU5MDM5NC02OWY1LTQyMzctOTE5MC0wMTIxNzcxNDVlMTAiXX0.WFYKu0Mc-ek0d7KpBvMXUo-iMl22kzHnnd1LYSQHWOjsaQLG6FsJ4T-h0uSh2FUoRoscXGXFn1oO-SN05HRF_ud-upGli8BndAYw9ZISza4mXieyUbT5metqppTgWx44JkYwHxBqpNppELihzd5_IlVJZwLybit-fafAqKwPBDMvNvCG0YZp-MhuSu8kRdXAtz7lQk3DsV0gty75x5Tj_kAQCa9hq5VzOyMMuanJFT1JL2klJxlOzw9fYLjIewa3Pra6YquVraSBK3aY4TDVm25vBQrJ3pe3H9dEPgmQPH6BBVli266uvSgnIaiY6_b6X_LzNe2l1gk2bSlSp1t4jA]
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 (Windows-10.0.10586) requests/2.9.1 msrest/0.4.0 msrest_azure/0.4.1
resourcemanagementclient/2016-02-01 Azure-SDK-For-Python AZURECLI/TEST/0.0.32]
accept-language: [en-US]
x-ms-client-request-id: [beaa7770-3d6c-11e6-9b7d-64510658e3b3]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/azure-cli-deployment-test/deployments/mock-deployment/operations?api-version=2016-02-01
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/In7xR5dZ
uc4/evS9X/xRMfvo0Ud3m/WkmdbFqi2qZXN3Z7J7/un+g93t3cn5zvb+bJZtZ/n03vZ08nDvwd75
zsP7D3fu1nlTretp/nldrVfN3ewH6zrfnpbF9ixfldX1Il+2223etHdXdXVZzPK6uftFMa2rpjpv
x6/05eauax2Hcbda5XUmeN3/9MH+w2c7B88OHu4+ebp3/NHoI/vtGcYRaUC9U5O2yJuPHv1i/HVZ
NNS8WF58SZ/zq/TiSZ1nbS7NbYPXLT579NHr9XSa57N8Rt+3xYLGlC1W9Pnezu6n2zufbu8dvNnb
ebS7++j+/fGnnz7c3324/1PUdLa24F++2b033v10f+/T+5++pq/aOpu+pR4Y6elufv/T+w/y7fNZ
Ptnez4juk3sPsu37k/O9T7PJwcEkm9I7TV5fFtP8Vf6L1oQBv7n3cOd8Z7azt72TPbi3vT+Z3Nt+
OM2n23v70537+7OdbO/eA7xJ41g3J9UMg/ny96JP2qy+yFszCSDMzw0bvMjbq6p+e3cpP1/n03Vd
tNcDsBjO9rK52KUhmH7fXK9oAB/dEqb34otsgRc3dPJLfskvGf1cUcbMzfsJyM7B/YMH9/b3P93b
Pdi/t3ewd3CwR0O2LZhrBhoRFtTsJkE5heYgsXhq+/9y3a7WrQCwr3wd0Tl4sLP/YG+vJzo74917
O/f29w56knN/drA/uX//4fa9hwd72/sHOwfbB3skCZ8+nOzOZg8n+WR2j96hTjv8L598kTdNdkEf
Ltdl+Ut+yfd/yf8DQYw1TRgFAAA=
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Length: ['704']
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 28 Jun 2016 20:13:14 GMT']
Expires: ['-1']
Pragma: [no-cache]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
version: 1

Просмотреть файл

@ -0,0 +1,40 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for the network security group."
}
},
"name": {
"type": "string",
"metadata": {
"description": "Name of the network security group."
}
}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[parameters('name')]",
"apiVersion": "2015-06-15",
"location": "[parameters('location')]",
"properties": {
"securityRules": [
]
},
"dependsOn": [ ]
}
],
"outputs": {
"NewNSG": {
"type": "object",
"value": "[reference(parameters('name'))]"
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"location": {
"value": "westus"
},
"name": {
"value": "azure-cli-deploy-test-nsg1"
}
}

Просмотреть файл

@ -1,7 +1,7 @@
import json
import os
# AZURE CLI RESOURCE TEST DEFINITIONS
from azure.cli.utils.vcr_test_base import VCRTestBase, JMESPathCheck, NoneCheck, BooleanCheck
from azure.cli.utils.vcr_test_base import VCRTestBase, JMESPathCheck, NoneCheck, BooleanCheck, ResourceGroupVCRTestBase
#pylint: disable=method-hidden
class ResourceGroupScenarioTest(VCRTestBase):
@ -164,3 +164,36 @@ class ProviderRegistrationTest(VCRTestBase):
self.cmd('resource provider show -n {}'.format(provider), checks=[JMESPathCheck('registrationState', 'Unregistered')])
self.cmd('resource provider register -n {}'.format(provider), checks=None)
self.cmd('resource provider show -n {}'.format(provider), checks=[JMESPathCheck('registrationState', 'Registered')])
class DeploymentTest(ResourceGroupVCRTestBase):
def __init__(self, test_method):
super(DeploymentTest, self).__init__(__file__, test_method)
self.resource_group = 'azure-cli-deployment-test'
def test_group_deployment(self):
self.execute()
def body(self):
curr_dir = os.path.dirname(os.path.realpath(__file__))
template_file = os.path.join(curr_dir, 'simple_deploy.json').replace('\\', '\\\\')
parameters_file = os.path.join(curr_dir, 'simple_deploy_parameters.json').replace('\\', '\\\\')
deployment_name = 'azure-cli-deployment'
result = self.cmd('resource group deployment validate -g {} --template-file-path {} --parameters-file-path {}'.format(
self.resource_group, template_file, parameters_file), checks=None)
self.assertEqual('Accepted', result['properties']['provisioningState'])
result = self.cmd('resource group deployment create -g {} -n {} --template-file-path {} --parameters-file-path {}'.format(
self.resource_group, deployment_name, template_file, parameters_file), checks=None)
self.assertEqual('Succeeded', result['properties']['provisioningState'])
self.assertEqual(self.resource_group, result['resourceGroup'])
result = self.cmd('resource group deployment list -g {}'.format(self.resource_group), checks=None)
self.assertEqual(deployment_name, result[0]['name'])
self.assertEqual(self.resource_group, result[0]['resourceGroup'])
result = self.cmd('resource group deployment show -g {} -n {}'.format(self.resource_group, deployment_name), checks=None)
self.assertEqual(deployment_name, result['name'])
self.assertEqual(self.resource_group, result['resourceGroup'])
result = self.cmd('resource group deployment exists -g {} -n {}'.format(self.resource_group, deployment_name), checks=None)
self.assertTrue(result)
result = self.cmd('resource group deployment operation list -g {} -n {}'.format(self.resource_group, deployment_name), checks=None)
self.assertEqual(2, len(result))
self.assertEqual(self.resource_group, result[0]['resourceGroup'])