Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/azure-cli/azure/cli/command_modules/resource/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,9 @@ def create_template_spec(cmd, resource_group_name, name, template_file=None, loc
location = rcf.resource_groups.get(resource_group_name).location
rcf = _resource_templatespecs_client_factory(cmd.cli_ctx)

if template_file and not version:
raise IncorrectUsageError('please provide --version if --template-file is specified')

if version:
Exists = False
if no_prompt is False:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ interactions:
ParameterSetName:
- -g -n -v -l -f --description --version-description
User-Agent:
- python/3.8.0 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.14.1
- python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: GET
Expand All @@ -32,7 +32,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 13 Nov 2020 04:10:28 GMT
- Thu, 07 Jan 2021 17:53:56 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -60,8 +60,8 @@ interactions:
ParameterSetName:
- -g -n -v -l -f --description --version-description
User-Agent:
- python/3.8.0 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.14.1
- python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: GET
Expand All @@ -79,7 +79,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 13 Nov 2020 04:10:28 GMT
- Thu, 07 Jan 2021 17:53:57 GMT
expires:
- '-1'
pragma:
Expand All @@ -95,7 +95,7 @@ interactions:
message: Not Found
- request:
body: '{"location": "westus", "properties": {"description": "AzCLI test root template
spec"}}'
spec"}, "tags": {}}'
headers:
Accept:
- application/json
Expand All @@ -106,36 +106,36 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '86'
- '98'
Content-Type:
- application/json; charset=utf-8
ParameterSetName:
- -g -n -v -l -f --description --version-description
User-Agent:
- python/3.8.0 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.14.1
- python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002?api-version=2019-06-01-preview
response:
body:
string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\":
\"[email protected]\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\":
\"2020-11-13T04:10:32.5222805Z\",\r\n \"lastModifiedBy\": \"[email protected]\",\r\n
\ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-11-13T04:10:32.5222805Z\"\r\n
\ },\r\n \"properties\": {\r\n \"description\": \"AzCLI test root template
spec\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002\",\r\n
string: "{\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"systemData\":
{\r\n \"createdBy\": \"[email protected]\",\r\n \"createdByType\":
\"User\",\r\n \"createdAt\": \"2021-01-07T17:53:59.5486662Z\",\r\n \"lastModifiedBy\":
\"[email protected]\",\r\n \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\":
\"2021-01-07T17:53:59.5486662Z\"\r\n },\r\n \"properties\": {\r\n \"description\":
\"AzCLI test root template spec\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002\",\r\n
\ \"type\": \"Microsoft.Resources/templateSpecs\",\r\n \"name\": \"cli-test-create-template-spec000002\"\r\n}"
headers:
cache-control:
- no-cache
content-length:
- '773'
- '790'
content-type:
- application/json; charset=utf-8
date:
- Fri, 13 Nov 2020 04:10:34 GMT
- Thu, 07 Jan 2021 17:53:59 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -226,7 +226,8 @@ interactions:
string(parameters(''instance''))), variables(''removeOptionalsFromHyphenedName''))]",
"name": "[if(parameters(''useHyphen''), variables(''hyphenedNameAfterInstanceCount''),
replace(variables(''hyphenedNameAfterInstanceCount''), ''-'', ''''))]"}, "resources":
[], "outputs": {"name": {"type": "string", "value": "[toLower(variables(''name''))]"}}}}}'
[], "outputs": {"name": {"type": "string", "value": "[toLower(variables(''name''))]"}}}},
"tags": {}}'
headers:
Accept:
- application/json
Expand All @@ -237,27 +238,27 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '6317'
- '6329'
Content-Type:
- application/json; charset=utf-8
ParameterSetName:
- -g -n -v -l -f --description --version-description
User-Agent:
- python/3.8.0 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.14.1
- python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_template_specs000001/providers/Microsoft.Resources/templateSpecs/cli-test-create-template-spec000002/versions/1.0?api-version=2019-06-01-preview
response:
body:
string: "{\r\n \"location\": \"westus\",\r\n \"systemData\": {\r\n \"createdBy\":
\"[email protected]\",\r\n \"createdByType\": \"User\",\r\n \"createdAt\":
\"2020-11-13T04:10:37.1123264Z\",\r\n \"lastModifiedBy\": \"[email protected]\",\r\n
\ \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\": \"2020-11-13T04:10:37.1123264Z\"\r\n
\ },\r\n \"properties\": {\r\n \"artifacts\": [],\r\n \"description\":
\"AzCLI test version of root template spec\",\r\n \"template\": {\r\n \"$schema\":
\"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n
string: "{\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"systemData\":
{\r\n \"createdBy\": \"[email protected]\",\r\n \"createdByType\":
\"User\",\r\n \"createdAt\": \"2021-01-07T17:54:00.8486769Z\",\r\n \"lastModifiedBy\":
\"[email protected]\",\r\n \"lastModifiedByType\": \"User\",\r\n \"lastModifiedAt\":
\"2021-01-07T17:54:00.8486769Z\"\r\n },\r\n \"properties\": {\r\n \"artifacts\":
[],\r\n \"description\": \"AzCLI test version of root template spec\",\r\n
\ \"template\": {\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n
\ \"contentVersion\": \"1.0.0.0\",\r\n \"parameters\": {\r\n \"customer\":
{\r\n \"type\": \"string\",\r\n \"minLength\": 2,\r\n \"maxLength\":
3,\r\n \"defaultValue\": \"[resourceGroup().tags['customer-short']]\",\r\n
Expand Down Expand Up @@ -380,11 +381,11 @@ interactions:
cache-control:
- no-cache
content-length:
- '9745'
- '9762'
content-type:
- application/json; charset=utf-8
date:
- Fri, 13 Nov 2020 04:10:37 GMT
- Thu, 07 Jan 2021 17:54:00 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -416,8 +417,8 @@ interactions:
ParameterSetName:
- --template-spec --yes
User-Agent:
- python/3.8.0 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/10.2.0 Azure-SDK-For-Python AZURECLI/2.14.1
- python/3.8.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3
azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.17.1
accept-language:
- en-US
method: DELETE
Expand All @@ -431,7 +432,7 @@ interactions:
content-length:
- '0'
date:
- Fri, 13 Nov 2020 04:10:42 GMT
- Thu, 07 Jan 2021 17:54:03 GMT
expires:
- '-1'
pragma:
Expand Down
Loading