diff --git a/src/SDKs/Compute/Compute.Tests/ScenarioTests/VMImageTests.cs b/src/SDKs/Compute/Compute.Tests/ScenarioTests/VMImageTests.cs index 95c81432ba7f..5bc2506a5a4f 100644 --- a/src/SDKs/Compute/Compute.Tests/ScenarioTests/VMImageTests.cs +++ b/src/SDKs/Compute/Compute.Tests/ScenarioTests/VMImageTests.cs @@ -51,6 +51,68 @@ public void TestVMImageGet() } } + [Fact] + public void TestVMImageAutomaticOSUpgradeProperties() + { + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + ComputeManagementClient _pirClient = ComputeManagementTestUtilities.GetComputeManagementClient(context, + new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }); + + // Validate if images supporting automatic OS upgrades return + // AutomaticOSUpgradeProperties.AutomaticOSUpgradeSupported = true in GET VMImageVesion call + string imagePublisher = "MicrosoftWindowsServer"; + string imageOffer = "WindowsServer"; + string imageSku = "2016-Datacenter"; + string[] availableWindowsServerImageVersions =_pirClient.VirtualMachineImages.List( + ComputeManagementTestUtilities.DefaultLocation, imagePublisher, imageOffer, imageSku).Select(t => t.Name).ToArray(); + + string firstVersion = availableWindowsServerImageVersions.First(); + string lastVersion = null; + if (availableWindowsServerImageVersions.Length >= 2) + { + lastVersion = availableWindowsServerImageVersions.Last(); + } + + var vmimage = _pirClient.VirtualMachineImages.Get( + ComputeManagementTestUtilities.DefaultLocation, imagePublisher, imageOffer, imageSku, firstVersion); + Assert.True(vmimage.AutomaticOSUpgradeProperties.AutomaticOSUpgradeSupported); + + if (!string.IsNullOrEmpty(lastVersion)) + { + vmimage = _pirClient.VirtualMachineImages.Get( + ComputeManagementTestUtilities.DefaultLocation, imagePublisher, imageOffer, imageSku, lastVersion); + Assert.True(vmimage.AutomaticOSUpgradeProperties.AutomaticOSUpgradeSupported); + } + + // Validate if image not whitelisted to support automatic OS upgrades, return + // AutomaticOSUpgradeProperties.AutomaticOSUpgradeSupported = false in GET VMImageVesion call + imagePublisher = "Canonical"; + imageOffer = "UbuntuServer"; + imageSku = "18.10-DAILY"; + string[] availableUbuntuImageVersions = _pirClient.VirtualMachineImages.List( + ComputeManagementTestUtilities.DefaultLocation, imagePublisher, imageOffer, imageSku).Select(t => t.Name).ToArray(); + + firstVersion = availableUbuntuImageVersions.First(); + lastVersion = null; + if (availableUbuntuImageVersions.Length >= 2) + { + lastVersion = availableUbuntuImageVersions.Last(); + } + + vmimage = _pirClient.VirtualMachineImages.Get( + ComputeManagementTestUtilities.DefaultLocation, imagePublisher, imageOffer, imageSku, firstVersion); + Assert.False(vmimage.AutomaticOSUpgradeProperties.AutomaticOSUpgradeSupported); + + if (!string.IsNullOrEmpty(lastVersion)) + { + vmimage = _pirClient.VirtualMachineImages.Get( + ComputeManagementTestUtilities.DefaultLocation, imagePublisher, imageOffer, imageSku, lastVersion); + Assert.False(vmimage.AutomaticOSUpgradeProperties.AutomaticOSUpgradeSupported); + } + } + } + [Fact] public void TestVMImageListNoFilter() { diff --git a/src/SDKs/Compute/Compute.Tests/SessionRecords/Compute.Tests.VMImagesTests/TestVMImageAutomaticOSUpgradeProperties.json b/src/SDKs/Compute/Compute.Tests/SessionRecords/Compute.Tests.VMImagesTests/TestVMImageAutomaticOSUpgradeProperties.json new file mode 100644 index 000000000000..7726f921fe57 --- /dev/null +++ b/src/SDKs/Compute/Compute.Tests/SessionRecords/Compute.Tests.VMImagesTests/TestVMImageAutomaticOSUpgradeProperties.json @@ -0,0 +1,410 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/providers/Microsoft.Compute/locations/SoutheastAsia/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2016-Datacenter/versions?api-version=2018-10-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTM5M2Y5MTktYTY4YS00M2QwLTkwNjMtNGIyYmRhNmJmZmRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9sb2NhdGlvbnMvU291dGhlYXN0QXNpYS9wdWJsaXNoZXJzL01pY3Jvc29mdFdpbmRvd3NTZXJ2ZXIvYXJ0aWZhY3R0eXBlcy92bWltYWdlL29mZmVycy9XaW5kb3dzU2VydmVyL3NrdXMvMjAxNi1EYXRhY2VudGVyL3ZlcnNpb25zP2FwaS12ZXJzaW9uPTIwMTgtMTAtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "aa4c610f-f11e-4eb3-ac6e-36b3606a3a48" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3163.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.15063", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/1.0.2595.0" + ] + }, + "ResponseBody": "[\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20170406\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20170406\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20170421\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20170421\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20170510\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20170510\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20170630\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20170630\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20170712\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20170712\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20170822\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20170822\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20170918\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20170918\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20171017\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20171017\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20171116\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20171116\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20171217\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20171217\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20180220\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20180220\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20180315\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20180315\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20180412\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20180412\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20180510\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20180510\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20180613\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20180613\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20180815\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20180815\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20180912\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20180912\"\r\n }\r\n]", + "ResponseHeaders": { + "Content-Length": [ + "5460" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-served-by": [ + "9fc414ea-410e-4600-9f7c-71bc36416f3f_131781312337009026" + ], + "x-ms-request-id": [ + "2d32af44-e7a2-489c-b148-ec591ea9841f" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "f0f7675d-8846-471e-a09f-87a770aac7e5" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180928T180705Z:f0f7675d-8846-471e-a09f-87a770aac7e5" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Fri, 28 Sep 2018 18:07:04 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/providers/Microsoft.Compute/locations/SoutheastAsia/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2016-Datacenter/versions/2016.127.20170406?api-version=2018-10-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTM5M2Y5MTktYTY4YS00M2QwLTkwNjMtNGIyYmRhNmJmZmRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9sb2NhdGlvbnMvU291dGhlYXN0QXNpYS9wdWJsaXNoZXJzL01pY3Jvc29mdFdpbmRvd3NTZXJ2ZXIvYXJ0aWZhY3R0eXBlcy92bWltYWdlL29mZmVycy9XaW5kb3dzU2VydmVyL3NrdXMvMjAxNi1EYXRhY2VudGVyL3ZlcnNpb25zLzIwMTYuMTI3LjIwMTcwNDA2P2FwaS12ZXJzaW9uPTIwMTgtMTAtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3165ff36-4156-45d3-9113-ba6850401b0d" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3163.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.15063", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/1.0.2595.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\": true\r\n },\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Windows\"\r\n },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20170406\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20170406\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "515" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-served-by": [ + "9fc414ea-410e-4600-9f7c-71bc36416f3f_131781312337009026" + ], + "x-ms-request-id": [ + "26a4c1c2-2d94-40b1-a357-e58d2acce40b" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "0a95d1cb-1e33-4062-8475-5a88e0a04e63" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180928T180706Z:0a95d1cb-1e33-4062-8475-5a88e0a04e63" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Fri, 28 Sep 2018 18:07:05 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/providers/Microsoft.Compute/locations/SoutheastAsia/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2016-Datacenter/versions/2016.127.20180912?api-version=2018-10-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTM5M2Y5MTktYTY4YS00M2QwLTkwNjMtNGIyYmRhNmJmZmRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9sb2NhdGlvbnMvU291dGhlYXN0QXNpYS9wdWJsaXNoZXJzL01pY3Jvc29mdFdpbmRvd3NTZXJ2ZXIvYXJ0aWZhY3R0eXBlcy92bWltYWdlL29mZmVycy9XaW5kb3dzU2VydmVyL3NrdXMvMjAxNi1EYXRhY2VudGVyL3ZlcnNpb25zLzIwMTYuMTI3LjIwMTgwOTEyP2FwaS12ZXJzaW9uPTIwMTgtMTAtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1c7fd265-06d4-4233-90ed-280d07e32d37" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3163.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.15063", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/1.0.2595.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\": true\r\n },\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Windows\"\r\n },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"southeastasia\",\r\n \"name\": \"2016.127.20180912\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2016-Datacenter/Versions/2016.127.20180912\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "515" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-served-by": [ + "9fc414ea-410e-4600-9f7c-71bc36416f3f_131781312337009026" + ], + "x-ms-request-id": [ + "eb11a348-1767-402a-826e-b875212db105" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "a357c725-1ed9-4d7b-85c8-a6360b7b5bd3" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180928T180706Z:a357c725-1ed9-4d7b-85c8-a6360b7b5bd3" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Fri, 28 Sep 2018 18:07:05 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/providers/Microsoft.Compute/locations/SoutheastAsia/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.10-DAILY/versions?api-version=2018-10-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTM5M2Y5MTktYTY4YS00M2QwLTkwNjMtNGIyYmRhNmJmZmRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9sb2NhdGlvbnMvU291dGhlYXN0QXNpYS9wdWJsaXNoZXJzL0Nhbm9uaWNhbC9hcnRpZmFjdHR5cGVzL3ZtaW1hZ2Uvb2ZmZXJzL1VidW50dVNlcnZlci9za3VzLzE4LjEwLURBSUxZL3ZlcnNpb25zP2FwaS12ZXJzaW9uPTIwMTgtMTAtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f127b8db-3efc-4976-9969-55282dc4c9c8" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3163.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.15063", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/1.0.2595.0" + ] + }, + "ResponseBody": "[\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809130\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809130\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809160\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809160\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809180\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809180\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809190\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809190\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809200\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809200\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809210\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809210\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809220\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809220\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809230\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809230\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809250\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809250\"\r\n },\r\n {\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809260\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809260\"\r\n }\r\n]", + "ResponseHeaders": { + "Content-Length": [ + "2993" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-served-by": [ + "5763bc19-56ac-4719-9ffa-8ce24fe8fe13_131781298989609472" + ], + "x-ms-request-id": [ + "12a83063-9c19-44a0-b38e-871eac8219f8" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "13f1071b-3587-48e9-8143-7167277c7a1a" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180928T180706Z:13f1071b-3587-48e9-8143-7167277c7a1a" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Fri, 28 Sep 2018 18:07:05 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/providers/Microsoft.Compute/locations/SoutheastAsia/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.10-DAILY/versions/18.10.201809130?api-version=2018-10-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTM5M2Y5MTktYTY4YS00M2QwLTkwNjMtNGIyYmRhNmJmZmRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9sb2NhdGlvbnMvU291dGhlYXN0QXNpYS9wdWJsaXNoZXJzL0Nhbm9uaWNhbC9hcnRpZmFjdHR5cGVzL3ZtaW1hZ2Uvb2ZmZXJzL1VidW50dVNlcnZlci9za3VzLzE4LjEwLURBSUxZL3ZlcnNpb25zLzE4LjEwLjIwMTgwOTEzMD9hcGktdmVyc2lvbj0yMDE4LTEwLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "32557014-1020-4bc1-bcdc-9ccd65db10be" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3163.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.15063", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/1.0.2595.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\": false\r\n },\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\"\r\n },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809130\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809130\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "492" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-served-by": [ + "5763bc19-56ac-4719-9ffa-8ce24fe8fe13_131781298989609472" + ], + "x-ms-request-id": [ + "4cb08236-af8d-47e4-815f-650d381de5a9" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "4fd59130-70b0-4741-930c-f09c0ff6659c" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180928T180706Z:4fd59130-70b0-4741-930c-f09c0ff6659c" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Fri, 28 Sep 2018 18:07:05 GMT" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/providers/Microsoft.Compute/locations/SoutheastAsia/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.10-DAILY/versions/18.10.201809260?api-version=2018-10-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTM5M2Y5MTktYTY4YS00M2QwLTkwNjMtNGIyYmRhNmJmZmRmL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9sb2NhdGlvbnMvU291dGhlYXN0QXNpYS9wdWJsaXNoZXJzL0Nhbm9uaWNhbC9hcnRpZmFjdHR5cGVzL3ZtaW1hZ2Uvb2ZmZXJzL1VidW50dVNlcnZlci9za3VzLzE4LjEwLURBSUxZL3ZlcnNpb25zLzE4LjEwLjIwMTgwOTI2MD9hcGktdmVyc2lvbj0yMDE4LTEwLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "544c602b-644b-4127-83d3-6ecdd43b256f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.7.3163.0", + "OSName/Windows10Enterprise", + "OSVersion/6.3.15063", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/1.0.2595.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\": false\r\n },\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\"\r\n },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"southeastasia\",\r\n \"name\": \"18.10.201809260\",\r\n \"id\": \"/Subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/Providers/Microsoft.Compute/Locations/southeastasia/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.10-DAILY/Versions/18.10.201809260\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "492" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Pragma": [ + "no-cache" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-served-by": [ + "5763bc19-56ac-4719-9ffa-8ce24fe8fe13_131781298989609472" + ], + "x-ms-request-id": [ + "3d0ac48d-a501-4086-b71c-38c9bd11a209" + ], + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "350acf02-469e-4aca-95ee-22a5e01ca7e7" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20180928T180706Z:350acf02-469e-4aca-95ee-22a5e01ca7e7" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Fri, 28 Sep 2018 18:07:05 GMT" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "5393f919-a68a-43d0-9063-4b2bda6bffdf" + } +} \ No newline at end of file diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/AutomaticOSUpgradeProperties.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/AutomaticOSUpgradeProperties.cs new file mode 100644 index 000000000000..2b459e236be1 --- /dev/null +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/AutomaticOSUpgradeProperties.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Compute.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes automatic OS upgrade properties on the image. + /// + public partial class AutomaticOSUpgradeProperties + { + /// + /// Initializes a new instance of the AutomaticOSUpgradeProperties + /// class. + /// + public AutomaticOSUpgradeProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AutomaticOSUpgradeProperties + /// class. + /// + /// Specifies whether + /// automatic OS upgrade is supported on the image. + public AutomaticOSUpgradeProperties(bool automaticOSUpgradeSupported) + { + AutomaticOSUpgradeSupported = automaticOSUpgradeSupported; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies whether automatic OS upgrade is supported on + /// the image. + /// + [JsonProperty(PropertyName = "automaticOSUpgradeSupported")] + public bool AutomaticOSUpgradeSupported { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineImage.cs b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineImage.cs index 4451688f446d..17db99e43775 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineImage.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/Models/VirtualMachineImage.cs @@ -42,12 +42,13 @@ public VirtualMachineImage() /// virtual machine. For more information about using tags, see [Using /// tags to organize your Azure /// resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - public VirtualMachineImage(string name, string location, string id = default(string), IDictionary tags = default(IDictionary), PurchasePlan plan = default(PurchasePlan), OSDiskImage osDiskImage = default(OSDiskImage), IList dataDiskImages = default(IList)) + public VirtualMachineImage(string name, string location, string id = default(string), IDictionary tags = default(IDictionary), PurchasePlan plan = default(PurchasePlan), OSDiskImage osDiskImage = default(OSDiskImage), IList dataDiskImages = default(IList), AutomaticOSUpgradeProperties automaticOSUpgradeProperties = default(AutomaticOSUpgradeProperties)) : base(name, location, id, tags) { Plan = plan; OsDiskImage = osDiskImage; DataDiskImages = dataDiskImages; + AutomaticOSUpgradeProperties = automaticOSUpgradeProperties; CustomInit(); } @@ -71,6 +72,11 @@ public VirtualMachineImage() [JsonProperty(PropertyName = "properties.dataDiskImages")] public IList DataDiskImages { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.automaticOSUpgradeProperties")] + public AutomaticOSUpgradeProperties AutomaticOSUpgradeProperties { get; set; } + /// /// Validate the object. /// @@ -88,6 +94,10 @@ public override void Validate() { OsDiskImage.Validate(); } + if (AutomaticOSUpgradeProperties != null) + { + AutomaticOSUpgradeProperties.Validate(); + } } } } diff --git a/src/SDKs/Compute/Management.Compute/Generated/SdkInfo_ComputeManagementClient.cs b/src/SDKs/Compute/Management.Compute/Generated/SdkInfo_ComputeManagementClient.cs index a6a7e5a31c52..0f660a013911 100644 --- a/src/SDKs/Compute/Management.Compute/Generated/SdkInfo_ComputeManagementClient.cs +++ b/src/SDKs/Compute/Management.Compute/Generated/SdkInfo_ComputeManagementClient.cs @@ -50,7 +50,7 @@ public static IEnumerable> ApiInfo_ComputeManageme public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\hylee-sdk\\september\\src\\SDKs"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "5ceecc250e5bd51b9d1b087a566c3563dd8e857e"; + public static readonly String GithubCommidId = "3f094a4eb44682f1608aaf836ca9ad8a8b15b6b9"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/src/SDKs/Compute/Management.Compute/Microsoft.Azure.Management.Compute.csproj b/src/SDKs/Compute/Management.Compute/Microsoft.Azure.Management.Compute.csproj index 1aa29b1e9332..10e348082640 100644 --- a/src/SDKs/Compute/Management.Compute/Microsoft.Azure.Management.Compute.csproj +++ b/src/SDKs/Compute/Management.Compute/Microsoft.Azure.Management.Compute.csproj @@ -6,12 +6,12 @@ Microsoft.Azure.Management.Compute Provides developers with libraries for the updated compute platform under Azure Resource manager to deploy virtual machine, virtual machine extensions and availability set management capabilities. Launch, restart, scale, capture and manage VMs, VM Extensions and more. Note: This client library is for Virtual Machines under Azure Resource Manager. - 23.0.0 + 23.1.0 Microsoft.Azure.Management.Compute management;virtual machine;compute; diff --git a/src/SDKs/Compute/Management.Compute/Properties/AssemblyInfo.cs b/src/SDKs/Compute/Management.Compute/Properties/AssemblyInfo.cs index 8f6465ac9e59..d6d22b8129bd 100644 --- a/src/SDKs/Compute/Management.Compute/Properties/AssemblyInfo.cs +++ b/src/SDKs/Compute/Management.Compute/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Compute Resources.")] [assembly: AssemblyVersion("23.0.0.0")] -[assembly: AssemblyFileVersion("23.0.0.0")] +[assembly: AssemblyFileVersion("23.1.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/src/SDKs/_metadata/compute_resource-manager.txt b/src/SDKs/_metadata/compute_resource-manager.txt index a9f6aa4bc483..b2c72ed19cda 100644 --- a/src/SDKs/_metadata/compute_resource-manager.txt +++ b/src/SDKs/_metadata/compute_resource-manager.txt @@ -4,11 +4,11 @@ Commencing code generation Generating CSharp code Executing AutoRest command cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\hylee-sdk\september\src\SDKs -2018-09-27 21:35:59 UTC +2018-09-28 22:48:43 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 5ceecc250e5bd51b9d1b087a566c3563dd8e857e +Commit: 3f094a4eb44682f1608aaf836ca9ad8a8b15b6b9 AutoRest information Requested version: latest Bootstrapper version: autorest@2.0.4283