From e2075b27ce3ed8fa256222b6440570728996085e Mon Sep 17 00:00:00 2001 From: Varad Meru Date: Tue, 28 Aug 2018 10:03:43 -0700 Subject: [PATCH 1/2] Fixing the spec for DSCConfigurations. The correct type was not being returned --- .../stable/2015-10-31/dscConfiguration.json | 5 ++++- .../2015-10-31/examples/getDscConfigurationContent.json | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscConfiguration.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscConfiguration.json index a54096f05cee..04cffd4f97e2 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscConfiguration.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscConfiguration.json @@ -278,6 +278,9 @@ "$ref": "./examples/getDscConfigurationContent.json" } }, + "produces": [ + "text/powershell" + ], "parameters": [ { "$ref": "../../common/v1/definitions.json#/parameters/ResourceGroupNameParameter" @@ -303,7 +306,7 @@ "200": { "description": "OK", "schema": { - "type": "string" + "type": "file" } }, "default": { diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getDscConfigurationContent.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getDscConfigurationContent.json index 01611177a33b..76ec5875c859 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getDscConfigurationContent.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getDscConfigurationContent.json @@ -8,7 +8,9 @@ }, "responses": { "200": { - "headers": {}, + "headers": { + "Content-Type": "text/powershell" + }, "body": "\tconfiguration TemplateWithConfigData{\r\n <#\r\n .DESCRIPTION\r\n DSC Coniguration that uses ConfigData file\r\n\r\n .EXAMPLE\r\n TemplateWithConfigData -outpath c:\\dsc\\\r\n\r\n .NOTES\r\n This configuration requires the corresponding configdata file\r\n #>\r\n\r\n Import-DscResource -ModuleName 'PSDesiredStateConfiguration', @{ModuleName='xPSDesiredStateConfiguration';ModuleVersion='5.0.0.0'\r\n }\r\n \r\n Node $AllNodes.NodeName{\r\n # WindowsOptionalFeature is compatible with the Nano Server installation option\r\n File testfile{\r\n Ensure = 'Present'\r\n DestinationPath = $Data.Path\r\n Contents = $Data.Contents\r\n }\r\n xArchive testarchive{\r\n Ensure = 'Present'\r\n Destination = $Data.Destination\r\n Path = (Get-ChildItem $Data.Path).ParentFolder\r\n }\r\n }\r\n }\r\n\r\nconfiguration TemplateBasic{\r\n <#\r\n .DESCRIPTION\r\n Basic configuration template\r\n\r\n .EXAMPLE\r\n TemplateBasic -outpath c:\\dsc\\\r\n\r\n .NOTES\r\n This is the most basic configuration and does not take parameters or configdata\r\n #>\r\n\r\n Import-DscResource -module 'PSDesiredStateConfiguration'\r\n \r\n Node localhost{\r\n # WindowsOptionalFeature is compatible with the Nano Server installation option\r\n File testfile{\r\n Ensure = 'Present'\r\n DestinationPath = 'c:\\filetoo.txt'\r\n Contents = 'this is some text too'\r\n }\r\n }\r\n }" } } From 7b22fa831cea703d538bf76fa8d6c281f1800b6d Mon Sep 17 00:00:00 2001 From: Varad Meru Date: Tue, 28 Aug 2018 14:47:44 -0700 Subject: [PATCH 2/2] Adding a new example for DSCConfiguration --- .../2015-10-31/examples/getDscConfigurationContent.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getDscConfigurationContent.json b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getDscConfigurationContent.json index 76ec5875c859..f00d86bb7ba6 100644 --- a/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getDscConfigurationContent.json +++ b/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getDscConfigurationContent.json @@ -3,7 +3,7 @@ "subscriptionId": "subid", "resourceGroupName": "rg", "automationAccountName": "myAutomationAccount33", - "configurationName": "TemplateBasic", + "configurationName": "ConfigName", "api-version": "2015-10-31" }, "responses": { @@ -11,7 +11,7 @@ "headers": { "Content-Type": "text/powershell" }, - "body": "\tconfiguration TemplateWithConfigData{\r\n <#\r\n .DESCRIPTION\r\n DSC Coniguration that uses ConfigData file\r\n\r\n .EXAMPLE\r\n TemplateWithConfigData -outpath c:\\dsc\\\r\n\r\n .NOTES\r\n This configuration requires the corresponding configdata file\r\n #>\r\n\r\n Import-DscResource -ModuleName 'PSDesiredStateConfiguration', @{ModuleName='xPSDesiredStateConfiguration';ModuleVersion='5.0.0.0'\r\n }\r\n \r\n Node $AllNodes.NodeName{\r\n # WindowsOptionalFeature is compatible with the Nano Server installation option\r\n File testfile{\r\n Ensure = 'Present'\r\n DestinationPath = $Data.Path\r\n Contents = $Data.Contents\r\n }\r\n xArchive testarchive{\r\n Ensure = 'Present'\r\n Destination = $Data.Destination\r\n Path = (Get-ChildItem $Data.Path).ParentFolder\r\n }\r\n }\r\n }\r\n\r\nconfiguration TemplateBasic{\r\n <#\r\n .DESCRIPTION\r\n Basic configuration template\r\n\r\n .EXAMPLE\r\n TemplateBasic -outpath c:\\dsc\\\r\n\r\n .NOTES\r\n This is the most basic configuration and does not take parameters or configdata\r\n #>\r\n\r\n Import-DscResource -module 'PSDesiredStateConfiguration'\r\n \r\n Node localhost{\r\n # WindowsOptionalFeature is compatible with the Nano Server installation option\r\n File testfile{\r\n Ensure = 'Present'\r\n DestinationPath = 'c:\\filetoo.txt'\r\n Contents = 'this is some text too'\r\n }\r\n }\r\n }" + "body": "Configuration ConfigName {\r\n Node localhost {\r\n WindowsFeature IIS {\r\n Name = \"Web-Server\";\r\n Ensure = \"Present\"\r\n }\r\n }\r\n}" } } } \ No newline at end of file