From 05bd9c60d615fdb08ab28ae841e0d8dca48265d2 Mon Sep 17 00:00:00 2001 From: Chen Shou Date: Tue, 22 Aug 2017 14:47:58 -0700 Subject: [PATCH 1/3] Add Azure container instance net SDK --- .../ContainerInstance.Tests.csproj | 33 + .../Helpers/ContainerInstanceTestUtilities.cs | 80 + .../Helpers/RecordedDelegatingHandler.cs | 90 ++ .../Properties/AssemblyInfo.cs | 29 + .../ContainerInstanceCreateTest.json | 137 ++ .../ContainerInstanceGetTest.json | 196 +++ ...tainerInstanceListByResourceGroupTest.json | 320 ++++ .../ContainerInstanceListTest.json | 320 ++++ .../Tests/ContainerInstanceTests.cs | 140 ++ .../ContainerInstance/ContainerInstance.sln | 28 + .../Generated/ContainerGroupsOperations.cs | 1389 +++++++++++++++++ .../ContainerGroupsOperationsExtensions.cs | 277 ++++ .../ContainerInstanceManagementClient.cs | 320 ++++ .../Generated/ContainerLogsOperations.cs | 264 ++++ .../ContainerLogsOperationsExtensions.cs | 75 + .../Generated/IContainerGroupsOperations.cs | 186 +++ .../IContainerInstanceManagementClient.cs | 79 + .../Generated/IContainerLogsOperations.cs | 55 + .../Generated/Models/AzureFileVolume.cs | 94 ++ .../Generated/Models/Container.cs | 171 ++ .../Generated/Models/ContainerEvent.cs | 80 + .../Generated/Models/ContainerGroup.cs | 169 ++ .../Models/ContainerGroupNetworkProtocol.cs | 19 + .../Generated/Models/ContainerPort.cs | 59 + .../Models/ContainerPropertiesInstanceView.cs | 78 + .../Models/ContainerRestartPolicy.cs | 18 + .../Generated/Models/ContainerState.cs | 83 + .../Generated/Models/EnvironmentVariable.cs | 74 + .../Models/ImageRegistryCredential.cs | 86 + .../Generated/Models/IpAddress.cs | 95 ++ .../Generated/Models/Logs.cs | 48 + .../Generated/Models/OperatingSystemTypes.cs | 19 + .../Generated/Models/Page.cs | 50 + .../Generated/Models/Port.cs | 67 + .../Generated/Models/Resource.cs | 97 ++ .../Generated/Models/ResourceLimits.cs | 57 + .../Generated/Models/ResourceRequests.cs | 67 + .../Generated/Models/ResourceRequirements.cs | 75 + .../Generated/Models/Volume.cs | 78 + .../Generated/Models/VolumeMount.cs | 86 + ....Azure.Management.ContainerInstance.csproj | 14 + .../Properties/AssemblyInfo.cs | 19 + .../Management.ContainerInstance/generate.cmd | 7 + src/SDKs/dirs.proj | 2 + 44 files changed, 5730 insertions(+) create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/Helpers/ContainerInstanceTestUtilities.cs create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/Helpers/RecordedDelegatingHandler.cs create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/Properties/AssemblyInfo.cs create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceCreateTest.json create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceGetTest.json create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceListByResourceGroupTest.json create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceListTest.json create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.Tests/Tests/ContainerInstanceTests.cs create mode 100644 src/SDKs/ContainerInstance/ContainerInstance.sln create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerGroupsOperations.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerGroupsOperationsExtensions.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerInstanceManagementClient.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerLogsOperations.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerLogsOperationsExtensions.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerGroupsOperations.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerInstanceManagementClient.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerLogsOperations.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/AzureFileVolume.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Container.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerEvent.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerGroup.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerGroupNetworkProtocol.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerPort.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerPropertiesInstanceView.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerRestartPolicy.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerState.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/EnvironmentVariable.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ImageRegistryCredential.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/IpAddress.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Logs.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/OperatingSystemTypes.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Page.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Port.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Resource.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceLimits.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceRequests.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceRequirements.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Volume.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/VolumeMount.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Microsoft.Azure.Management.ContainerInstance.csproj create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs create mode 100644 src/SDKs/ContainerInstance/Management.ContainerInstance/generate.cmd diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj b/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj new file mode 100644 index 000000000000..10dd08685bef --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj @@ -0,0 +1,33 @@ + + + + ContainerInstance.Tests + ContainerInstance.Tests Class Library + ContainerInstance.Tests + 1.0.0-preview + + + + netcoreapp1.1 + + + + + + + + + + + + PreserveNewest + + + + + + + + diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/Helpers/ContainerInstanceTestUtilities.cs b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Helpers/ContainerInstanceTestUtilities.cs new file mode 100644 index 000000000000..cc30169ba8e4 --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Helpers/ContainerInstanceTestUtilities.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.Azure.Management.ContainerInstance; +using Microsoft.Azure.Management.ContainerInstance.Models; +using Microsoft.Azure.Management.Resources; +using Microsoft.Azure.Management.Resources.Models; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using Xunit; + +namespace ContainerInstance.Tests +{ + public class ContainerInstanceTestUtilities + { + public static ResourceManagementClient GetResourceManagementClient(MockContext context, RecordedDelegatingHandler handler) + { + handler.IsPassThrough = true; + var client = context.GetServiceClient(handlers: handler); + return client; + } + + public static ContainerInstanceManagementClient GetContainerInstanceManagementClient(MockContext context, RecordedDelegatingHandler handler) + { + handler.IsPassThrough = true; + var client = context.GetServiceClient(handlers: handler); + return client; + } + + public static ResourceGroup CreateResourceGroup(ResourceManagementClient client) + { + var resourceGroupName = TestUtilities.GenerateName("aci_rg"); + + return client.ResourceGroups.CreateOrUpdate(resourceGroupName, new ResourceGroup + { + Location = "westus" + }); + } + + public static ContainerGroup CreateTestContainerGroup(string containerGroupName) + { + var containers = new Container[] + { + new Container( + name: containerGroupName, + image: "nginx:latest", + ports: new List() { new ContainerPort(80) }, + resources: new ResourceRequirements(requests: new ResourceRequests(memoryInGB: 1.5, cpu: 1.0))) + }; + + var ipAddress = new IpAddress( + new List() { new Port(80, "TCP") }); + + var containerGroup = new ContainerGroup( + name: containerGroupName, + location: "westus", + osType: OperatingSystemTypes.Linux, + ipAddress: ipAddress, + containers: containers); + + return containerGroup; + } + + public static void VerifyContainerGroupProperties(ContainerGroup expected, ContainerGroup actual) + { + Assert.NotNull(actual); + Assert.Equal(expected.Name, actual.Name); + Assert.Equal(expected.Location, actual.Location); + Assert.Equal(expected.OsType, actual.OsType); + Assert.NotNull(actual.Containers); + Assert.Equal(1, actual.Containers.Count); + Assert.NotNull(actual.IpAddress); + Assert.NotNull(actual.IpAddress.Ip); + Assert.Equal(expected.Containers[0].Name, actual.Containers[0].Name); + Assert.Equal(expected.Containers[0].Image, actual.Containers[0].Image); + Assert.Equal(expected.Containers[0].Resources.Requests.Cpu, actual.Containers[0].Resources.Requests.Cpu); + Assert.Equal(expected.Containers[0].Resources.Requests.MemoryInGB, actual.Containers[0].Resources.Requests.MemoryInGB); + } + } +} diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/Helpers/RecordedDelegatingHandler.cs b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Helpers/RecordedDelegatingHandler.cs new file mode 100644 index 000000000000..00c9ef59043b --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Helpers/RecordedDelegatingHandler.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; + +namespace ContainerInstance.Tests +{ + public class RecordedDelegatingHandler : DelegatingHandler + { + private HttpResponseMessage _response; + + public RecordedDelegatingHandler() + { + StatusCodeToReturn = HttpStatusCode.Created; + SubsequentStatusCodeToReturn = StatusCodeToReturn; + } + + public RecordedDelegatingHandler(HttpResponseMessage response) + { + StatusCodeToReturn = HttpStatusCode.Created; + SubsequentStatusCodeToReturn = StatusCodeToReturn; + _response = response; + } + + public HttpStatusCode StatusCodeToReturn { get; set; } + + public HttpStatusCode SubsequentStatusCodeToReturn { get; set; } + + public string Request { get; private set; } + + public HttpRequestHeaders RequestHeaders { get; private set; } + + public HttpContentHeaders ContentHeaders { get; private set; } + + public HttpMethod Method { get; private set; } + + public Uri Uri { get; private set; } + + public bool IsPassThrough { get; set; } + + private int counter; + + protected override async Task SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) + { + counter++; + // Save request + if (request.Content == null) + { + Request = string.Empty; + } + else + { + Request = await request.Content.ReadAsStringAsync(); + } + RequestHeaders = request.Headers; + if (request.Content != null) + { + ContentHeaders = request.Content.Headers; + } + Method = request.Method; + Uri = request.RequestUri; + + // Prepare response + if (IsPassThrough) + { + return await base.SendAsync(request, cancellationToken); + } + else + { + if (_response != null && counter == 1) + { + return _response; + } + else + { + var statusCode = StatusCodeToReturn; + if (counter > 1) + statusCode = SubsequentStatusCodeToReturn; + HttpResponseMessage response = new HttpResponseMessage(statusCode); + response.Content = new StringContent(""); + return response; + } + } + } + } +} diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/Properties/AssemblyInfo.cs b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..4a13c1d9a024 --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Xunit; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ContainerInstance.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ContainerInstance.Tests")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("80C5B642-F93C-4E68-9B37-04565D3CF6AB")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceCreateTest.json b/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceCreateTest.json new file mode 100644 index 000000000000..fed93cc9bf9a --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceCreateTest.json @@ -0,0 +1,137 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourcegroups/aci_rg7133?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlZ3JvdXBzL2FjaV9yZzcxMzM/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "0f03cad0-3a92-4c4f-aa61-7f877e4a00b9" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg7133\",\r\n \"name\": \"aci_rg7133\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "173" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:54 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-request-id": [ + "49e9ad80-fe75-4b14-94a3-533597114274" + ], + "x-ms-correlation-request-id": [ + "49e9ad80-fe75-4b14-94a3-533597114274" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205055Z:49e9ad80-fe75-4b14-94a3-533597114274" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg7133/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk3461?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlR3JvdXBzL2FjaV9yZzcxMzMvcHJvdmlkZXJzL01pY3Jvc29mdC5Db250YWluZXJJbnN0YW5jZS9jb250YWluZXJHcm91cHMvYWNpbmV0c2RrMzQ2MT9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk3461\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "616" + ], + "x-ms-client-request-id": [ + "c99141ec-f9d1-4cee-90b2-6116a00f3062" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk3461\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"13.64.187.73\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg7133/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk3461\",\r\n \"name\": \"acinetsdk3461\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "582" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:55 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:d5c346f1-58e5-4c29-9a4c-e2306966df45" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "7e8ace92-15fa-4c79-ad1e-70abf48d92fc" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205055Z:7e8ace92-15fa-4c79-ad1e-70abf48d92fc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + } + ], + "Names": { + "CreateResourceGroup": [ + "aci_rg7133" + ], + "ContainerInstanceCreateTest": [ + "acinetsdk3461" + ] + }, + "Variables": { + "SubscriptionId": "6987baff-3f62-48c9-a604-3432d813f7e6" + } +} \ No newline at end of file diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceGetTest.json b/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceGetTest.json new file mode 100644 index 000000000000..c2aa947a0851 --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceGetTest.json @@ -0,0 +1,196 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourcegroups/aci_rg9832?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlZ3JvdXBzL2FjaV9yZzk4MzI/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "018be974-9ffe-4276-8c27-89d4884e54f1" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg9832\",\r\n \"name\": \"aci_rg9832\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "173" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1189" + ], + "x-ms-request-id": [ + "9eae3d4b-143c-4abb-b05f-e644d28a0623" + ], + "x-ms-correlation-request-id": [ + "9eae3d4b-143c-4abb-b05f-e644d28a0623" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205032Z:9eae3d4b-143c-4abb-b05f-e644d28a0623" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg9832/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1184?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlR3JvdXBzL2FjaV9yZzk4MzIvcHJvdmlkZXJzL01pY3Jvc29mdC5Db250YWluZXJJbnN0YW5jZS9jb250YWluZXJHcm91cHMvYWNpbmV0c2RrMTE4ND9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk1184\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "616" + ], + "x-ms-client-request-id": [ + "2828e0bb-29b2-4a47-887b-23cf422fb66f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk1184\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"13.64.184.174\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg9832/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1184\",\r\n \"name\": \"acinetsdk1184\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "583" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:c9076cc0-c8dd-4da6-8f01-c5de4250734b" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1188" + ], + "x-ms-correlation-request-id": [ + "ddc09059-d26e-41b0-9740-575518327813" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205033Z:ddc09059-d26e-41b0-9740-575518327813" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg9832/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1184?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlR3JvdXBzL2FjaV9yZzk4MzIvcHJvdmlkZXJzL01pY3Jvc29mdC5Db250YWluZXJJbnN0YW5jZS9jb250YWluZXJHcm91cHMvYWNpbmV0c2RrMTE4ND9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0c3a7408-8921-49aa-98c6-b6c0b1d7758d" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk1184\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"13.64.184.174\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\",\r\n \"state\": \"Pending\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg9832/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1184\",\r\n \"name\": \"acinetsdk1184\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Accept-Encoding", + "Accept-Encoding" + ], + "x-ms-request-id": [ + "westus:6c915216-80d5-4aa1-8fde-006e912c02c2" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14943" + ], + "x-ms-correlation-request-id": [ + "8035df30-839d-48ba-a889-95eb4938048a" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205033Z:8035df30-839d-48ba-a889-95eb4938048a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "CreateResourceGroup": [ + "aci_rg9832" + ], + "ContainerInstanceGetTest": [ + "acinetsdk1184" + ] + }, + "Variables": { + "SubscriptionId": "6987baff-3f62-48c9-a604-3432d813f7e6" + } +} \ No newline at end of file diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceListByResourceGroupTest.json b/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceListByResourceGroupTest.json new file mode 100644 index 000000000000..9ad039629896 --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceListByResourceGroupTest.json @@ -0,0 +1,320 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourcegroups/aci_rg8961?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlZ3JvdXBzL2FjaV9yZzg5NjE/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "6ac971cf-903b-4faa-b343-f07c686cc312" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg8961\",\r\n \"name\": \"aci_rg8961\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "173" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:40 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-request-id": [ + "86518622-5f32-45c9-a848-b4257564399b" + ], + "x-ms-correlation-request-id": [ + "86518622-5f32-45c9-a848-b4257564399b" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205041Z:86518622-5f32-45c9-a848-b4257564399b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg8961/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1677?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlR3JvdXBzL2FjaV9yZzg5NjEvcHJvdmlkZXJzL01pY3Jvc29mdC5Db250YWluZXJJbnN0YW5jZS9jb250YWluZXJHcm91cHMvYWNpbmV0c2RrMTY3Nz9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk1677\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "616" + ], + "x-ms-client-request-id": [ + "c68b418a-bffa-48c8-a150-63245984fd79" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk1677\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"40.85.159.103\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg8961/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1677\",\r\n \"name\": \"acinetsdk1677\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "583" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:12303c6a-54c3-452a-9112-13f64879d136" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "85e997df-078f-4e6f-b59f-99db99201074" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205042Z:85e997df-078f-4e6f-b59f-99db99201074" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourcegroups/aci_rg1302?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlZ3JvdXBzL2FjaV9yZzEzMDI/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "52da0fc6-14e9-4900-b645-274ea303b477" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg1302\",\r\n \"name\": \"aci_rg1302\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "173" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:42 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-request-id": [ + "ea30ff62-bfc8-4b1e-9155-7e44f1a155b5" + ], + "x-ms-correlation-request-id": [ + "ea30ff62-bfc8-4b1e-9155-7e44f1a155b5" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205042Z:ea30ff62-bfc8-4b1e-9155-7e44f1a155b5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg1302/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk6903?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlR3JvdXBzL2FjaV9yZzEzMDIvcHJvdmlkZXJzL01pY3Jvc29mdC5Db250YWluZXJJbnN0YW5jZS9jb250YWluZXJHcm91cHMvYWNpbmV0c2RrNjkwMz9hcGktdmVyc2lvbj0yMDE3LTA4LTAxLXByZXZpZXc=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk6903\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "616" + ], + "x-ms-client-request-id": [ + "1a89ef2a-f669-410c-8766-e0b0d18b14ed" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk6903\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"104.40.89.117\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg1302/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk6903\",\r\n \"name\": \"acinetsdk6903\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "583" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:43 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:61baee43-bc8e-4ea4-a21b-366b123a9354" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1192" + ], + "x-ms-correlation-request-id": [ + "c6525b37-a52a-4a55-9462-eaec5c556483" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205043Z:c6525b37-a52a-4a55-9462-eaec5c556483" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg8961/providers/Microsoft.ContainerInstance/containerGroups?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlR3JvdXBzL2FjaV9yZzg5NjEvcHJvdmlkZXJzL01pY3Jvc29mdC5Db250YWluZXJJbnN0YW5jZS9jb250YWluZXJHcm91cHM/YXBpLXZlcnNpb249MjAxNy0wOC0wMS1wcmV2aWV3", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f17fa9ec-5c0d-4961-84ae-ef2b0cb3bbc7" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk1677\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"40.85.159.103\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg8961/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1677\",\r\n \"name\": \"acinetsdk1677\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:50:43 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Accept-Encoding", + "Accept-Encoding" + ], + "x-ms-request-id": [ + "westus:fef27566-fb09-49a1-b76f-4229f8c8f9b3" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14958" + ], + "x-ms-correlation-request-id": [ + "61e9666e-18c1-49b4-9ce6-22ae5557918c" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205043Z:61e9666e-18c1-49b4-9ce6-22ae5557918c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "CreateResourceGroup": [ + "aci_rg8961", + "aci_rg1302" + ], + "ContainerInstanceListByResourceGroupTest": [ + "acinetsdk1677", + "acinetsdk6903" + ] + }, + "Variables": { + "SubscriptionId": "6987baff-3f62-48c9-a604-3432d813f7e6" + } +} \ No newline at end of file diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceListTest.json b/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceListTest.json new file mode 100644 index 000000000000..c039c69dfb71 --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/SessionRecords/ContainerInstance.Tests.ContainerInstanceTests/ContainerInstanceListTest.json @@ -0,0 +1,320 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourcegroups/aci_rg134?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlZ3JvdXBzL2FjaV9yZzEzND9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "a041fe08-8d6c-4a72-adec-84a4bd172dcd" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg134\",\r\n \"name\": \"aci_rg134\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:51:02 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-request-id": [ + "0a8fc70c-f049-48ab-92a1-7bee878696d4" + ], + "x-ms-correlation-request-id": [ + "0a8fc70c-f049-48ab-92a1-7bee878696d4" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205102Z:0a8fc70c-f049-48ab-92a1-7bee878696d4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg134/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk5941?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlR3JvdXBzL2FjaV9yZzEzNC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbnRhaW5lckluc3RhbmNlL2NvbnRhaW5lckdyb3Vwcy9hY2luZXRzZGs1OTQxP2FwaS12ZXJzaW9uPTIwMTctMDgtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk5941\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "616" + ], + "x-ms-client-request-id": [ + "02b9ba3c-d7e2-4f24-bb09-0944233f75b3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk5941\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"13.91.47.226\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg134/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk5941\",\r\n \"name\": \"acinetsdk5941\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "581" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:51:03 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:84c25e4b-50ae-4192-a8e4-6a93e4909796" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "95a987ba-7621-4c89-ad84-1e0719e44946" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205103Z:95a987ba-7621-4c89-ad84-1e0719e44946" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourcegroups/aci_rg700?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlZ3JvdXBzL2FjaV9yZzcwMD9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "cd63e46b-716f-45bf-bbc3-3d8a9911784e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg700\",\r\n \"name\": \"aci_rg700\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:51:03 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-request-id": [ + "5ddf4420-2630-4976-bbe0-5c7f47bae610" + ], + "x-ms-correlation-request-id": [ + "5ddf4420-2630-4976-bbe0-5c7f47bae610" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205103Z:5ddf4420-2630-4976-bbe0-5c7f47bae610" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg700/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk4671?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Jlc291cmNlR3JvdXBzL2FjaV9yZzcwMC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbnRhaW5lckluc3RhbmNlL2NvbnRhaW5lckdyb3Vwcy9hY2luZXRzZGs0NjcxP2FwaS12ZXJzaW9uPTIwMTctMDgtMDEtcHJldmlldw==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk4671\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "616" + ], + "x-ms-client-request-id": [ + "90a4a151-5343-4d64-95fd-e48f2126feb1" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk4671\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"40.80.157.221\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg700/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk4671\",\r\n \"name\": \"acinetsdk4671\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "582" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:51:04 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "westus:c60de62b-9f12-4538-9e43-ba9845d21cf0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "47f3bc75-3e1c-4841-89c1-c20a2b15bbc0" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205104Z:47f3bc75-3e1c-4841-89c1-c20a2b15bbc0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/providers/Microsoft.ContainerInstance/containerGroups?api-version=2017-08-01-preview", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjk4N2JhZmYtM2Y2Mi00OGM5LWE2MDQtMzQzMmQ4MTNmN2U2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29udGFpbmVySW5zdGFuY2UvY29udGFpbmVyR3JvdXBzP2FwaS12ZXJzaW9uPTIwMTctMDgtMDEtcHJldmlldw==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9bc230fe-bd25-40f2-9a8b-d59fa517f520" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.25211.01", + "Microsoft.Azure.Management.ContainerInstance.ContainerInstanceManagementClient/1.2.0.0" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk6903\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"104.40.89.117\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg1302/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk6903\",\r\n \"name\": \"acinetsdk6903\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n },\r\n {\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk5941\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"13.91.47.226\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg134/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk5941\",\r\n \"name\": \"acinetsdk5941\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n },\r\n {\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk4671\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"40.80.157.221\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg700/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk4671\",\r\n \"name\": \"acinetsdk4671\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n },\r\n {\r\n \"properties\": {\r\n \"provisioningState\": \"Creating\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk3461\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"13.64.187.73\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg7133/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk3461\",\r\n \"name\": \"acinetsdk3461\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n },\r\n {\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk1677\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"40.85.159.103\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg8961/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1677\",\r\n \"name\": \"acinetsdk1677\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n },\r\n {\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"containers\": [\r\n {\r\n \"name\": \"acinetsdk1184\",\r\n \"properties\": {\r\n \"image\": \"nginx:latest\",\r\n \"ports\": [\r\n {\r\n \"port\": 80\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 80\r\n }\r\n ],\r\n \"ip\": \"13.64.184.174\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/aci_rg9832/providers/Microsoft.ContainerInstance/containerGroups/acinetsdk1184\",\r\n \"name\": \"acinetsdk1184\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"westus\"\r\n },\r\n {\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"containers\": [\r\n {\r\n \"name\": \"containerinboundconnectivityfromwestus636390317757734615\",\r\n \"properties\": {\r\n \"image\": \"caasrunner.azurecr.io/nmap-ncat\",\r\n \"command\": [\r\n \"ncat\",\r\n \"-l\",\r\n \"6639\",\r\n \"-k\"\r\n ],\r\n \"ports\": [\r\n {\r\n \"port\": 6639\r\n }\r\n ],\r\n \"environmentVariables\": [],\r\n \"resources\": {\r\n \"requests\": {\r\n \"memoryInGB\": 1.5,\r\n \"cpu\": 1.0\r\n }\r\n }\r\n }\r\n }\r\n ],\r\n \"imageRegistryCredentials\": [\r\n {\r\n \"server\": \"caasrunner.azurecr.io\",\r\n \"username\": \"CaaSRunner\"\r\n }\r\n ],\r\n \"ipAddress\": {\r\n \"ports\": [\r\n {\r\n \"protocol\": \"TCP\",\r\n \"port\": 6639\r\n }\r\n ],\r\n \"ip\": \"40.71.216.239\",\r\n \"type\": \"Public\"\r\n },\r\n \"osType\": \"Linux\"\r\n },\r\n \"id\": \"/subscriptions/6987baff-3f62-48c9-a604-3432d813f7e6/resourceGroups/CaaSRunner/providers/Microsoft.ContainerInstance/containerGroups/containerinboundconnectivityfromwestus636390317757734615\",\r\n \"name\": \"containerinboundconnectivityfromwestus636390317757734615\",\r\n \"type\": \"Microsoft.ContainerInstance/containerGroups\",\r\n \"location\": \"EastUS\"\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 22 Aug 2017 20:51:05 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-original-request-ids": [ + "westus:3df29de1-75b0-473f-a60f-ba9c3cee4297", + "eastus:dbe8cb33-f77e-4c9b-9cbd-2294e93f0d7c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14963" + ], + "x-ms-request-id": [ + "5489cd59-fbe1-42df-be79-945583ce47bd" + ], + "x-ms-correlation-request-id": [ + "5489cd59-fbe1-42df-be79-945583ce47bd" + ], + "x-ms-routing-request-id": [ + "WESTUS:20170822T205105Z:5489cd59-fbe1-42df-be79-945583ce47bd" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "CreateResourceGroup": [ + "aci_rg134", + "aci_rg700" + ], + "ContainerInstanceListTest": [ + "acinetsdk5941", + "acinetsdk4671" + ] + }, + "Variables": { + "SubscriptionId": "6987baff-3f62-48c9-a604-3432d813f7e6" + } +} \ No newline at end of file diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/Tests/ContainerInstanceTests.cs b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Tests/ContainerInstanceTests.cs new file mode 100644 index 000000000000..9af7b5061f93 --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Tests/ContainerInstanceTests.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Linq; +using System.Net; +using Microsoft.Azure.Management.ContainerInstance; +using Microsoft.Azure.Management.Resources; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using Xunit; + +namespace ContainerInstance.Tests +{ + /// + /// Tests for container instance SDK. + /// + public class ContainerInstanceTests : TestBase + { + /// + /// Test create container instance. + /// + [Fact] + public void ContainerInstanceCreateTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + var resourceClient = ContainerInstanceTestUtilities.GetResourceManagementClient(context, handler); + var containerInstanceClient = ContainerInstanceTestUtilities.GetContainerInstanceManagementClient(context, handler); + + var resourceGroup = ContainerInstanceTestUtilities.CreateResourceGroup(resourceClient); + + // Create container group. + var containerGroupName = TestUtilities.GenerateName("acinetsdk"); + var containerGroup = ContainerInstanceTestUtilities.CreateTestContainerGroup(containerGroupName); + + // Verify created container group. + var createdContainerGroup = containerInstanceClient.ContainerGroups.CreateOrUpdate(resourceGroup.Name, containerGroupName, containerGroup); + ContainerInstanceTestUtilities.VerifyContainerGroupProperties(containerGroup, createdContainerGroup); + } + } + + /// + /// Test get container instance. + /// + [Fact] + public void ContainerInstanceGetTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + var resourceClient = ContainerInstanceTestUtilities.GetResourceManagementClient(context, handler); + var containerInstanceClient = ContainerInstanceTestUtilities.GetContainerInstanceManagementClient(context, handler); + + var resourceGroup = ContainerInstanceTestUtilities.CreateResourceGroup(resourceClient); + + // Create container group. + var containerGroupName = TestUtilities.GenerateName("acinetsdk"); + var containerGroup = ContainerInstanceTestUtilities.CreateTestContainerGroup(containerGroupName); + + // Verify created container group. + var createdContainerGroup = containerInstanceClient.ContainerGroups.CreateOrUpdate(resourceGroup.Name, containerGroupName, containerGroup); + ContainerInstanceTestUtilities.VerifyContainerGroupProperties(containerGroup, createdContainerGroup); + + // Verifiy retrieved container group. + var retrievedContainerGroup = containerInstanceClient.ContainerGroups.Get(resourceGroup.Name, containerGroupName); + ContainerInstanceTestUtilities.VerifyContainerGroupProperties(containerGroup, retrievedContainerGroup); + } + } + + /// + /// Test list container instances. + /// + [Fact] + public void ContainerInstanceListTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + var resourceClient = ContainerInstanceTestUtilities.GetResourceManagementClient(context, handler); + var containerInstanceClient = ContainerInstanceTestUtilities.GetContainerInstanceManagementClient(context, handler); + + // Create 2 container groups. + var resourceGroup1 = ContainerInstanceTestUtilities.CreateResourceGroup(resourceClient); + var containerGroupName1 = TestUtilities.GenerateName("acinetsdk"); + var containerGroup1 = ContainerInstanceTestUtilities.CreateTestContainerGroup(containerGroupName1); + containerInstanceClient.ContainerGroups.CreateOrUpdate(resourceGroup1.Name, containerGroupName1, containerGroup1); + + var resourceGroup2 = ContainerInstanceTestUtilities.CreateResourceGroup(resourceClient); + var containerGroupName2 = TestUtilities.GenerateName("acinetsdk"); + var containerGroup2 = ContainerInstanceTestUtilities.CreateTestContainerGroup(containerGroupName2); + containerInstanceClient.ContainerGroups.CreateOrUpdate(resourceGroup2.Name, containerGroupName2, containerGroup2); + + // Verify both container group exist when listing. + var retrievedContainerGroups = containerInstanceClient.ContainerGroups.List(); + Assert.True(retrievedContainerGroups.Count() >= 2); + var retrievedContainerGroup1 = retrievedContainerGroups.Where(cg => cg.Name == containerGroupName1).FirstOrDefault(); + ContainerInstanceTestUtilities.VerifyContainerGroupProperties(containerGroup1, retrievedContainerGroup1); + var retrievedContainerGroup2 = retrievedContainerGroups.Where(cg => cg.Name == containerGroupName2).FirstOrDefault(); + ContainerInstanceTestUtilities.VerifyContainerGroupProperties(containerGroup2, retrievedContainerGroup2); + } + } + + /// + /// Test list container instances by resource group. + /// + [Fact] + public void ContainerInstanceListByResourceGroupTest() + { + var handler = new RecordedDelegatingHandler { StatusCodeToReturn = HttpStatusCode.OK }; + + using (MockContext context = MockContext.Start(this.GetType().FullName)) + { + var resourceClient = ContainerInstanceTestUtilities.GetResourceManagementClient(context, handler); + var containerInstanceClient = ContainerInstanceTestUtilities.GetContainerInstanceManagementClient(context, handler); + + // Create 2 container groups. + var resourceGroup1 = ContainerInstanceTestUtilities.CreateResourceGroup(resourceClient); + var containerGroupName1 = TestUtilities.GenerateName("acinetsdk"); + var containerGroup1 = ContainerInstanceTestUtilities.CreateTestContainerGroup(containerGroupName1); + containerInstanceClient.ContainerGroups.CreateOrUpdate(resourceGroup1.Name, containerGroupName1, containerGroup1); + + var resourceGroup2 = ContainerInstanceTestUtilities.CreateResourceGroup(resourceClient); + var containerGroupName2 = TestUtilities.GenerateName("acinetsdk"); + var containerGroup2 = ContainerInstanceTestUtilities.CreateTestContainerGroup(containerGroupName2); + containerInstanceClient.ContainerGroups.CreateOrUpdate(resourceGroup2.Name, containerGroupName2, containerGroup2); + + // Verify only one exists when listing by resource group. + var retrievedContainerGroups = containerInstanceClient.ContainerGroups.ListByResourceGroup(resourceGroup1.Name); + Assert.True(retrievedContainerGroups.Count() >= 1); + var retrievedContainerGroup1 = retrievedContainerGroups.Where(cg => cg.Name == containerGroupName1).FirstOrDefault(); + ContainerInstanceTestUtilities.VerifyContainerGroupProperties(containerGroup1, retrievedContainerGroup1); + var retrievedContainerGroup2 = retrievedContainerGroups.Where(cg => cg.Name == containerGroupName2).FirstOrDefault(); + Assert.Null(retrievedContainerGroup2); + } + } + } +} diff --git a/src/SDKs/ContainerInstance/ContainerInstance.sln b/src/SDKs/ContainerInstance/ContainerInstance.sln new file mode 100644 index 000000000000..c1a31ba5f101 --- /dev/null +++ b/src/SDKs/ContainerInstance/ContainerInstance.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.4 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ContainerInstance.Tests", "ContainerInstance.Tests\ContainerInstance.Tests.csproj", "{80C5B642-F93C-4E68-9B37-04565D3CF6AB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Management.ContainerInstance", "Management.ContainerInstance\Microsoft.Azure.Management.ContainerInstance.csproj", "{D8A4B1DB-D54E-4702-9D93-5DCC314C157E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {80C5B642-F93C-4E68-9B37-04565D3CF6AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80C5B642-F93C-4E68-9B37-04565D3CF6AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80C5B642-F93C-4E68-9B37-04565D3CF6AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80C5B642-F93C-4E68-9B37-04565D3CF6AB}.Release|Any CPU.Build.0 = Release|Any CPU + {D8A4B1DB-D54E-4702-9D93-5DCC314C157E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8A4B1DB-D54E-4702-9D93-5DCC314C157E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8A4B1DB-D54E-4702-9D93-5DCC314C157E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8A4B1DB-D54E-4702-9D93-5DCC314C157E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerGroupsOperations.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerGroupsOperations.cs new file mode 100644 index 000000000000..ccfe21a3dfec --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerGroupsOperations.cs @@ -0,0 +1,1389 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ContainerGroupsOperations operations. + /// + internal partial class ContainerGroupsOperations : IServiceOperations, IContainerGroupsOperations + { + /// + /// Initializes a new instance of the ContainerGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ContainerGroupsOperations(ContainerInstanceManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ContainerInstanceManagementClient + /// + public ContainerInstanceManagementClient Client { get; private set; } + + /// + /// Get the list of container groups in a given subscription. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get the list of container groups in a given resource group. + /// + /// + /// Azure resource group name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get details for this container group. + /// + /// + /// Azure resource group name + /// + /// + /// Container group name + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string containerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (containerGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("containerGroupName", containerGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{containerGroupName}", System.Uri.EscapeDataString(containerGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update container groups. + /// + /// + /// Azure resource group name + /// + /// + /// Container group name + /// + /// + /// Definition of the container to be created. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerGroupName, ContainerGroup containerGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (containerGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerGroupName"); + } + if (containerGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerGroup"); + } + if (containerGroup != null) + { + containerGroup.Validate(); + } + if (containerGroup == null) + { + containerGroup = new ContainerGroup(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("containerGroupName", containerGroupName); + tracingParameters.Add("containerGroup", containerGroup); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{containerGroupName}", System.Uri.EscapeDataString(containerGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(containerGroup != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(containerGroup, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete container groups. + /// + /// + /// Azure resource group name + /// + /// + /// Name of the container group to be deleted + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string containerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (containerGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("containerGroupName", containerGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{containerGroupName}", System.Uri.EscapeDataString(containerGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get the list of container groups in a given subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get the list of container groups in a given resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerGroupsOperationsExtensions.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..ac16735354c1 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerGroupsOperationsExtensions.cs @@ -0,0 +1,277 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ContainerGroupsOperations. + /// + public static partial class ContainerGroupsOperationsExtensions + { + /// + /// Get the list of container groups in a given subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IContainerGroupsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Get the list of container groups in a given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IContainerGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the list of container groups in a given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + public static IPage ListByResourceGroup(this IContainerGroupsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get the list of container groups in a given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IContainerGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get details for this container group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// Container group name + /// + public static ContainerGroup Get(this IContainerGroupsOperations operations, string resourceGroupName, string containerGroupName) + { + return operations.GetAsync(resourceGroupName, containerGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get details for this container group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// Container group name + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IContainerGroupsOperations operations, string resourceGroupName, string containerGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, containerGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update container groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// Container group name + /// + /// + /// Definition of the container to be created. + /// + public static ContainerGroup CreateOrUpdate(this IContainerGroupsOperations operations, string resourceGroupName, string containerGroupName, ContainerGroup containerGroup) + { + return operations.CreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).GetAwaiter().GetResult(); + } + + /// + /// Create or update container groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// Container group name + /// + /// + /// Definition of the container to be created. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IContainerGroupsOperations operations, string resourceGroupName, string containerGroupName, ContainerGroup containerGroup, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, containerGroupName, containerGroup, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete container groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// Name of the container group to be deleted + /// + public static ContainerGroup Delete(this IContainerGroupsOperations operations, string resourceGroupName, string containerGroupName) + { + return operations.DeleteAsync(resourceGroupName, containerGroupName).GetAwaiter().GetResult(); + } + + /// + /// Delete container groups. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// Name of the container group to be deleted + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IContainerGroupsOperations operations, string resourceGroupName, string containerGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, containerGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the list of container groups in a given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IContainerGroupsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get the list of container groups in a given subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IContainerGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the list of container groups in a given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IContainerGroupsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get the list of container groups in a given resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IContainerGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerInstanceManagementClient.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerInstanceManagementClient.cs new file mode 100644 index 000000000000..e8bcfa7e5c39 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerInstanceManagementClient.cs @@ -0,0 +1,320 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + public partial class ContainerInstanceManagementClient : ServiceClient, IContainerInstanceManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// Subscription credentials which uniquely identify Microsoft Azure + /// subscription. The subscription ID forms part of the URI for every service + /// call. + /// + public string SubscriptionId { get; set; } + + /// + /// Client API version + /// + public string ApiVersion { get; private set; } + + /// + /// Gets or sets the preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// Gets or sets the retry timeout in seconds for Long Running Operations. + /// Default value is 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// When set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IContainerGroupsOperations. + /// + public virtual IContainerGroupsOperations ContainerGroups { get; private set; } + + /// + /// Gets the IContainerLogsOperations. + /// + public virtual IContainerLogsOperations ContainerLogs { get; private set; } + + /// + /// Initializes a new instance of the ContainerInstanceManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected ContainerInstanceManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the ContainerInstanceManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected ContainerInstanceManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the ContainerInstanceManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected ContainerInstanceManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the ContainerInstanceManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected ContainerInstanceManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the ContainerInstanceManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public ContainerInstanceManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the ContainerInstanceManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public ContainerInstanceManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the ContainerInstanceManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public ContainerInstanceManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the ContainerInstanceManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public ContainerInstanceManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + ContainerGroups = new ContainerGroupsOperations(this); + ContainerLogs = new ContainerLogsOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2017-08-01-preview"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerLogsOperations.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerLogsOperations.cs new file mode 100644 index 000000000000..fd866a6ca5c1 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerLogsOperations.cs @@ -0,0 +1,264 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ContainerLogsOperations operations. + /// + internal partial class ContainerLogsOperations : IServiceOperations, IContainerLogsOperations + { + /// + /// Initializes a new instance of the ContainerLogsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ContainerLogsOperations(ContainerInstanceManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ContainerInstanceManagementClient + /// + public ContainerInstanceManagementClient Client { get; private set; } + + /// + /// Get the logs for this container. + /// + /// + /// Azure resource group name + /// + /// + /// Container name + /// + /// + /// Container group name + /// + /// + /// Only show this number of log lines. If not provided, all available logs are + /// shown. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string containerName, string containerGroupName, int? tail = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (containerGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("containerGroupName", containerGroupName); + tracingParameters.Add("tail", tail); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{containerGroupName}", System.Uri.EscapeDataString(containerGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (tail != null) + { + _queryParameters.Add(string.Format("tail={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(tail, Client.SerializationSettings).Trim('"')))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerLogsOperationsExtensions.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerLogsOperationsExtensions.cs new file mode 100644 index 000000000000..368d9ad33c8b --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/ContainerLogsOperationsExtensions.cs @@ -0,0 +1,75 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ContainerLogsOperations. + /// + public static partial class ContainerLogsOperationsExtensions + { + /// + /// Get the logs for this container. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// Container name + /// + /// + /// Container group name + /// + /// + /// Only show this number of log lines. If not provided, all available logs are + /// shown. + /// + public static Logs List(this IContainerLogsOperations operations, string resourceGroupName, string containerName, string containerGroupName, int? tail = default(int?)) + { + return operations.ListAsync(resourceGroupName, containerName, containerGroupName, tail).GetAwaiter().GetResult(); + } + + /// + /// Get the logs for this container. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Azure resource group name + /// + /// + /// Container name + /// + /// + /// Container group name + /// + /// + /// Only show this number of log lines. If not provided, all available logs are + /// shown. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IContainerLogsOperations operations, string resourceGroupName, string containerName, string containerGroupName, int? tail = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, containerName, containerGroupName, tail, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerGroupsOperations.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerGroupsOperations.cs new file mode 100644 index 000000000000..bed38ece8043 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerGroupsOperations.cs @@ -0,0 +1,186 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ContainerGroupsOperations operations. + /// + public partial interface IContainerGroupsOperations + { + /// + /// Get the list of container groups in a given subscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the list of container groups in a given resource group. + /// + /// + /// Azure resource group name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get details for this container group. + /// + /// + /// Azure resource group name + /// + /// + /// Container group name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string containerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update container groups. + /// + /// + /// Azure resource group name + /// + /// + /// Container group name + /// + /// + /// Definition of the container to be created. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string containerGroupName, ContainerGroup containerGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete container groups. + /// + /// + /// Azure resource group name + /// + /// + /// Name of the container group to be deleted + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string containerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the list of container groups in a given subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the list of container groups in a given resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerInstanceManagementClient.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerInstanceManagementClient.cs new file mode 100644 index 000000000000..d66752a370fb --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerInstanceManagementClient.cs @@ -0,0 +1,79 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// + public partial interface IContainerInstanceManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// Subscription credentials which uniquely identify Microsoft Azure + /// subscription. The subscription ID forms part of the URI for every + /// service call. + /// + string SubscriptionId { get; set; } + + /// + /// Client API version + /// + string ApiVersion { get; } + + /// + /// Gets or sets the preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// Gets or sets the retry timeout in seconds for Long Running + /// Operations. Default value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// When set to true a unique x-ms-client-request-id value is generated + /// and included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IContainerGroupsOperations. + /// + IContainerGroupsOperations ContainerGroups { get; } + + /// + /// Gets the IContainerLogsOperations. + /// + IContainerLogsOperations ContainerLogs { get; } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerLogsOperations.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerLogsOperations.cs new file mode 100644 index 000000000000..9e8b53f1fb56 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/IContainerLogsOperations.cs @@ -0,0 +1,55 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ContainerLogsOperations operations. + /// + public partial interface IContainerLogsOperations + { + /// + /// Get the logs for this container. + /// + /// + /// Azure resource group name + /// + /// + /// Container name + /// + /// + /// Container group name + /// + /// + /// Only show this number of log lines. If not provided, all available + /// logs are shown. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListWithHttpMessagesAsync(string resourceGroupName, string containerName, string containerGroupName, int? tail = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/AzureFileVolume.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/AzureFileVolume.cs new file mode 100644 index 000000000000..fe0f5c454e30 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/AzureFileVolume.cs @@ -0,0 +1,94 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Azure file volume. + /// + public partial class AzureFileVolume + { + /// + /// Initializes a new instance of the AzureFileVolume class. + /// + public AzureFileVolume() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureFileVolume class. + /// + /// The Azure file share name. + /// The storage account name to access + /// to the Azure file. + /// The flag indicating whether the + /// Azure file volume is read only. + /// The storage account key to access + /// to the Azure file. + public AzureFileVolume(string shareName, string storageAccountName, bool? readOnlyProperty = default(bool?), string storageAccountKey = default(string)) + { + ShareName = shareName; + ReadOnlyProperty = readOnlyProperty; + StorageAccountName = storageAccountName; + StorageAccountKey = storageAccountKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Azure file share name. + /// + [JsonProperty(PropertyName = "shareName")] + public string ShareName { get; set; } + + /// + /// Gets or sets the flag indicating whether the Azure file volume is + /// read only. + /// + [JsonProperty(PropertyName = "readOnly")] + public bool? ReadOnlyProperty { get; set; } + + /// + /// Gets or sets the storage account name to access to the Azure file. + /// + [JsonProperty(PropertyName = "storageAccountName")] + public string StorageAccountName { get; set; } + + /// + /// Gets or sets the storage account key to access to the Azure file. + /// + [JsonProperty(PropertyName = "storageAccountKey")] + public string StorageAccountKey { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ShareName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ShareName"); + } + if (StorageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountName"); + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Container.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Container.cs new file mode 100644 index 000000000000..c98ab72ad0fa --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Container.cs @@ -0,0 +1,171 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A container instance. + /// + [Rest.Serialization.JsonTransformation] + public partial class Container + { + /// + /// Initializes a new instance of the Container class. + /// + public Container() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Container class. + /// + /// The user-provided name of this container + /// The name of the image used when creating this + /// container + /// The resource requirements of this + /// container. + /// Command array to execute within the container + /// in exec form. + /// The ports exposed by this container + /// The environment variables to set + /// in this container + /// The instance view of the container. Only + /// valid in response. + /// The volume mounts. + public Container(string name, string image, ResourceRequirements resources, IList command = default(IList), IList ports = default(IList), IList environmentVariables = default(IList), ContainerPropertiesInstanceView instanceView = default(ContainerPropertiesInstanceView), IList volumeMounts = default(IList)) + { + Name = name; + Image = image; + Command = command; + Ports = ports; + EnvironmentVariables = environmentVariables; + InstanceView = instanceView; + Resources = resources; + VolumeMounts = volumeMounts; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the user-provided name of this container + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the name of the image used when creating this + /// container + /// + [JsonProperty(PropertyName = "properties.image")] + public string Image { get; set; } + + /// + /// Gets or sets command array to execute within the container in exec + /// form. + /// + [JsonProperty(PropertyName = "properties.command")] + public IList Command { get; set; } + + /// + /// Gets or sets the ports exposed by this container + /// + [JsonProperty(PropertyName = "properties.ports")] + public IList Ports { get; set; } + + /// + /// Gets or sets the environment variables to set in this container + /// + [JsonProperty(PropertyName = "properties.environmentVariables")] + public IList EnvironmentVariables { get; set; } + + /// + /// Gets the instance view of the container. Only valid in response. + /// + [JsonProperty(PropertyName = "properties.instanceView")] + public ContainerPropertiesInstanceView InstanceView { get; private set; } + + /// + /// Gets or sets the resource requirements of this container. + /// + [JsonProperty(PropertyName = "properties.resources")] + public ResourceRequirements Resources { get; set; } + + /// + /// Gets or sets the volume mounts. + /// + [JsonProperty(PropertyName = "properties.volumeMounts")] + public IList VolumeMounts { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Image == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Image"); + } + if (Resources == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Resources"); + } + if (Ports != null) + { + foreach (var element in Ports) + { + if (element != null) + { + element.Validate(); + } + } + } + if (EnvironmentVariables != null) + { + foreach (var element1 in EnvironmentVariables) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (Resources != null) + { + Resources.Validate(); + } + if (VolumeMounts != null) + { + foreach (var element2 in VolumeMounts) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerEvent.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerEvent.cs new file mode 100644 index 000000000000..22ea97bd3b97 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerEvent.cs @@ -0,0 +1,80 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A container event. + /// + public partial class ContainerEvent + { + /// + /// Initializes a new instance of the ContainerEvent class. + /// + public ContainerEvent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerEvent class. + /// + /// The count of the event. + /// Date/time of the first event. + /// Date/time of the last event. + /// The event message + /// The event type. + public ContainerEvent(int? count = default(int?), System.DateTime? firstTimestamp = default(System.DateTime?), System.DateTime? lastTimestamp = default(System.DateTime?), string message = default(string), string type = default(string)) + { + Count = count; + FirstTimestamp = firstTimestamp; + LastTimestamp = lastTimestamp; + Message = message; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the count of the event. + /// + [JsonProperty(PropertyName = "count")] + public int? Count { get; set; } + + /// + /// Gets or sets date/time of the first event. + /// + [JsonProperty(PropertyName = "firstTimestamp")] + public System.DateTime? FirstTimestamp { get; set; } + + /// + /// Gets or sets date/time of the last event. + /// + [JsonProperty(PropertyName = "lastTimestamp")] + public System.DateTime? LastTimestamp { get; set; } + + /// + /// Gets or sets the event message + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets the event type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerGroup.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerGroup.cs new file mode 100644 index 000000000000..76a3108267fb --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerGroup.cs @@ -0,0 +1,169 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A container group. + /// + [Rest.Serialization.JsonTransformation] + public partial class ContainerGroup : Resource + { + /// + /// Initializes a new instance of the ContainerGroup class. + /// + public ContainerGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerGroup class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// The provisioning state, which only + /// appears in the response. + /// The containers in this container + /// group. + /// The image registry + /// credentials by which the container group is created from. + /// - `always` Always restart + /// . Possible values include: 'always' + /// The IP address type. + /// The base level OS type required by the + /// containers in the group. Possible values include: 'Windows', + /// 'Linux' + /// The state of the container group. Only valid in + /// response. + /// The volumes for this container group. + public ContainerGroup(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList containers = default(IList), IList imageRegistryCredentials = default(IList), string restartPolicy = default(string), IpAddress ipAddress = default(IpAddress), string osType = default(string), string state = default(string), IList volumes = default(IList)) + : base(location, id, name, type, tags) + { + ProvisioningState = provisioningState; + Containers = containers; + ImageRegistryCredentials = imageRegistryCredentials; + RestartPolicy = restartPolicy; + IpAddress = ipAddress; + OsType = osType; + State = state; + Volumes = volumes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the containers in this container group. + /// + [JsonProperty(PropertyName = "properties.containers")] + public IList Containers { get; set; } + + /// + /// Gets or sets the image registry credentials by which the container + /// group is created from. + /// + [JsonProperty(PropertyName = "properties.imageRegistryCredentials")] + public IList ImageRegistryCredentials { get; set; } + + /// + /// Gets or sets - `always` Always restart + /// . Possible values include: 'always' + /// + [JsonProperty(PropertyName = "properties.restartPolicy")] + public string RestartPolicy { get; set; } + + /// + /// Gets or sets the IP address type. + /// + [JsonProperty(PropertyName = "properties.ipAddress")] + public IpAddress IpAddress { get; set; } + + /// + /// Gets or sets the base level OS type required by the containers in + /// the group. Possible values include: 'Windows', 'Linux' + /// + [JsonProperty(PropertyName = "properties.osType")] + public string OsType { get; set; } + + /// + /// Gets the state of the container group. Only valid in response. + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets or sets the volumes for this container group. + /// + [JsonProperty(PropertyName = "properties.volumes")] + public IList Volumes { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Containers != null) + { + foreach (var element in Containers) + { + if (element != null) + { + element.Validate(); + } + } + } + if (ImageRegistryCredentials != null) + { + foreach (var element1 in ImageRegistryCredentials) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (IpAddress != null) + { + IpAddress.Validate(); + } + if (Volumes != null) + { + foreach (var element2 in Volumes) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerGroupNetworkProtocol.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerGroupNetworkProtocol.cs new file mode 100644 index 000000000000..1d9708e45912 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerGroupNetworkProtocol.cs @@ -0,0 +1,19 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + + /// + /// Defines values for ContainerGroupNetworkProtocol. + /// + public static class ContainerGroupNetworkProtocol + { + public const string TCP = "TCP"; + public const string UDP = "UDP"; + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerPort.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerPort.cs new file mode 100644 index 000000000000..d86adb9e29da --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerPort.cs @@ -0,0 +1,59 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The container port. + /// + public partial class ContainerPort + { + /// + /// Initializes a new instance of the ContainerPort class. + /// + public ContainerPort() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerPort class. + /// + /// Port number to expose within the container + /// group. + public ContainerPort(int port) + { + Port = port; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets port number to expose within the container group. + /// + [JsonProperty(PropertyName = "port")] + public int Port { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerPropertiesInstanceView.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerPropertiesInstanceView.cs new file mode 100644 index 000000000000..1df8fd899e5e --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerPropertiesInstanceView.cs @@ -0,0 +1,78 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The instance view of the container. Only valid in response. + /// + public partial class ContainerPropertiesInstanceView + { + /// + /// Initializes a new instance of the ContainerPropertiesInstanceView + /// class. + /// + public ContainerPropertiesInstanceView() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerPropertiesInstanceView + /// class. + /// + /// The number of times that the container + /// has been restarted. + /// Current container state. + /// Previous container state. + /// The events of this container instance. + public ContainerPropertiesInstanceView(int? restartCount = default(int?), ContainerState currentState = default(ContainerState), ContainerState previousState = default(ContainerState), IList events = default(IList)) + { + RestartCount = restartCount; + CurrentState = currentState; + PreviousState = previousState; + Events = events; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the number of times that the container has been + /// restarted. + /// + [JsonProperty(PropertyName = "restartCount")] + public int? RestartCount { get; set; } + + /// + /// Gets or sets current container state. + /// + [JsonProperty(PropertyName = "currentState")] + public ContainerState CurrentState { get; set; } + + /// + /// Gets or sets previous container state. + /// + [JsonProperty(PropertyName = "previousState")] + public ContainerState PreviousState { get; set; } + + /// + /// Gets or sets the events of this container instance. + /// + [JsonProperty(PropertyName = "events")] + public IList Events { get; set; } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerRestartPolicy.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerRestartPolicy.cs new file mode 100644 index 000000000000..b1793c7c452c --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerRestartPolicy.cs @@ -0,0 +1,18 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + + /// + /// Defines values for ContainerRestartPolicy. + /// + public static class ContainerRestartPolicy + { + public const string Always = "always"; + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerState.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerState.cs new file mode 100644 index 000000000000..a488dc5157d2 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ContainerState.cs @@ -0,0 +1,83 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The container state. + /// + public partial class ContainerState + { + /// + /// Initializes a new instance of the ContainerState class. + /// + public ContainerState() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContainerState class. + /// + /// The state of this container + /// Date/time when the container state + /// started. + /// The container exit code. + /// Date/time when the container state + /// finished. + /// Human-readable status of this + /// state. + public ContainerState(string state = default(string), System.DateTime? startTime = default(System.DateTime?), int? exitCode = default(int?), System.DateTime? finishTime = default(System.DateTime?), string detailStatus = default(string)) + { + State = state; + StartTime = startTime; + ExitCode = exitCode; + FinishTime = finishTime; + DetailStatus = detailStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the state of this container + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + /// + /// Gets or sets date/time when the container state started. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; set; } + + /// + /// Gets or sets the container exit code. + /// + [JsonProperty(PropertyName = "exitCode")] + public int? ExitCode { get; set; } + + /// + /// Gets or sets date/time when the container state finished. + /// + [JsonProperty(PropertyName = "finishTime")] + public System.DateTime? FinishTime { get; set; } + + /// + /// Gets or sets human-readable status of this state. + /// + [JsonProperty(PropertyName = "detailStatus")] + public string DetailStatus { get; set; } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/EnvironmentVariable.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/EnvironmentVariable.cs new file mode 100644 index 000000000000..31e224acef6e --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/EnvironmentVariable.cs @@ -0,0 +1,74 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Environment variable to set within the container. + /// + public partial class EnvironmentVariable + { + /// + /// Initializes a new instance of the EnvironmentVariable class. + /// + public EnvironmentVariable() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EnvironmentVariable class. + /// + /// The name of the environment variable. + /// The value of the environment variable. + public EnvironmentVariable(string name, string value) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the environment variable. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the value of the environment variable. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ImageRegistryCredential.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ImageRegistryCredential.cs new file mode 100644 index 000000000000..7574468df9d5 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ImageRegistryCredential.cs @@ -0,0 +1,86 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Image registry credential. + /// + public partial class ImageRegistryCredential + { + /// + /// Initializes a new instance of the ImageRegistryCredential class. + /// + public ImageRegistryCredential() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ImageRegistryCredential class. + /// + /// Docker image registry server, without protocol + /// such as "http" and "https". + /// The username for the private + /// registry. + /// The password for the private + /// registry. + public ImageRegistryCredential(string server, string username, string password = default(string)) + { + Server = server; + Username = username; + Password = password; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets docker image registry server, without protocol such as + /// "http" and "https". + /// + [JsonProperty(PropertyName = "server")] + public string Server { get; set; } + + /// + /// Gets or sets the username for the private registry. + /// + [JsonProperty(PropertyName = "username")] + public string Username { get; set; } + + /// + /// Gets or sets the password for the private registry. + /// + [JsonProperty(PropertyName = "password")] + public string Password { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Server == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Server"); + } + if (Username == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Username"); + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/IpAddress.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/IpAddress.cs new file mode 100644 index 000000000000..f7d7fec6ed93 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/IpAddress.cs @@ -0,0 +1,95 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IP address for the group. + /// + public partial class IpAddress + { + /// + /// Initializes a new instance of the IpAddress class. + /// + public IpAddress() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IpAddress class. + /// + /// The ports. + /// The IP exposed to the public internet. + public IpAddress(IList ports, string ip = default(string)) + { + Ports = ports; + Ip = ip; + CustomInit(); + } + /// + /// Static constructor for IpAddress class. + /// + static IpAddress() + { + Type = "Public"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ports. + /// + [JsonProperty(PropertyName = "ports")] + public IList Ports { get; set; } + + /// + /// Gets or sets the IP exposed to the public internet. + /// + [JsonProperty(PropertyName = "ip")] + public string Ip { get; set; } + + /// + /// Determines whether the IP is exposed to the public internet. + /// + [JsonProperty(PropertyName = "type")] + public static string Type { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Ports == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Ports"); + } + if (Ports != null) + { + foreach (var element in Ports) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Logs.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Logs.cs new file mode 100644 index 000000000000..299b3889279a --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Logs.cs @@ -0,0 +1,48 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The logs. + /// + public partial class Logs + { + /// + /// Initializes a new instance of the Logs class. + /// + public Logs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Logs class. + /// + /// content of the log. + public Logs(string content = default(string)) + { + Content = content; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets content of the log. + /// + [JsonProperty(PropertyName = "content")] + public string Content { get; set; } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/OperatingSystemTypes.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/OperatingSystemTypes.cs new file mode 100644 index 000000000000..022389f3b355 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/OperatingSystemTypes.cs @@ -0,0 +1,19 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + + /// + /// Defines values for OperatingSystemTypes. + /// + public static class OperatingSystemTypes + { + public const string Windows = "Windows"; + public const string Linux = "Linux"; + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Page.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Page.cs new file mode 100644 index 000000000000..d752b02425f4 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Page.cs @@ -0,0 +1,50 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Port.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Port.cs new file mode 100644 index 000000000000..b3808db3545c --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Port.cs @@ -0,0 +1,67 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The port. + /// + public partial class Port + { + /// + /// Initializes a new instance of the Port class. + /// + public Port() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Port class. + /// + /// The port. + /// The protocol associated with the port. + /// Possible values include: 'TCP', 'UDP' + public Port(int portProperty, string protocol = default(string)) + { + Protocol = protocol; + PortProperty = portProperty; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the protocol associated with the port. Possible values + /// include: 'TCP', 'UDP' + /// + [JsonProperty(PropertyName = "protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets the port. + /// + [JsonProperty(PropertyName = "port")] + public int PortProperty { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Resource.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Resource.cs new file mode 100644 index 000000000000..c2d284ecca7b --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Resource.cs @@ -0,0 +1,97 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Resource model definition. + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceLimits.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceLimits.cs new file mode 100644 index 000000000000..73f16d15d625 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceLimits.cs @@ -0,0 +1,57 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource limits. + /// + public partial class ResourceLimits + { + /// + /// Initializes a new instance of the ResourceLimits class. + /// + public ResourceLimits() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceLimits class. + /// + /// The memory limit in GB of this + /// container. + /// The CPU limit of this container. + public ResourceLimits(double? memoryInGB = default(double?), double? cpu = default(double?)) + { + MemoryInGB = memoryInGB; + Cpu = cpu; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the memory limit in GB of this container. + /// + [JsonProperty(PropertyName = "memoryInGB")] + public double? MemoryInGB { get; set; } + + /// + /// Gets or sets the CPU limit of this container. + /// + [JsonProperty(PropertyName = "cpu")] + public double? Cpu { get; set; } + + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceRequests.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceRequests.cs new file mode 100644 index 000000000000..65ffa43371a4 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceRequests.cs @@ -0,0 +1,67 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource requests. + /// + public partial class ResourceRequests + { + /// + /// Initializes a new instance of the ResourceRequests class. + /// + public ResourceRequests() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceRequests class. + /// + /// The memory request in GB of this + /// container. + /// The CPU request of this container. + public ResourceRequests(double memoryInGB, double cpu) + { + MemoryInGB = memoryInGB; + Cpu = cpu; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the memory request in GB of this container. + /// + [JsonProperty(PropertyName = "memoryInGB")] + public double MemoryInGB { get; set; } + + /// + /// Gets or sets the CPU request of this container. + /// + [JsonProperty(PropertyName = "cpu")] + public double Cpu { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceRequirements.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceRequirements.cs new file mode 100644 index 000000000000..969c48d4dd8b --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/ResourceRequirements.cs @@ -0,0 +1,75 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource requirements. + /// + public partial class ResourceRequirements + { + /// + /// Initializes a new instance of the ResourceRequirements class. + /// + public ResourceRequirements() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceRequirements class. + /// + /// The resource requests of this + /// container. + /// The resource limits of this container. + public ResourceRequirements(ResourceRequests requests, ResourceLimits limits = default(ResourceLimits)) + { + Requests = requests; + Limits = limits; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource requests of this container. + /// + [JsonProperty(PropertyName = "requests")] + public ResourceRequests Requests { get; set; } + + /// + /// Gets or sets the resource limits of this container. + /// + [JsonProperty(PropertyName = "limits")] + public ResourceLimits Limits { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Requests == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Requests"); + } + if (Requests != null) + { + Requests.Validate(); + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Volume.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Volume.cs new file mode 100644 index 000000000000..20c9a78cee5e --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/Volume.cs @@ -0,0 +1,78 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The volume. + /// + public partial class Volume + { + /// + /// Initializes a new instance of the Volume class. + /// + public Volume() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Volume class. + /// + /// The volume name. + /// The Azure file volume. + public Volume(string name, AzureFileVolume azureFile) + { + Name = name; + AzureFile = azureFile; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the volume name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the Azure file volume. + /// + [JsonProperty(PropertyName = "azureFile")] + public AzureFileVolume AzureFile { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (AzureFile == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AzureFile"); + } + if (AzureFile != null) + { + AzureFile.Validate(); + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/VolumeMount.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/VolumeMount.cs new file mode 100644 index 000000000000..f06eb8ec8052 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Generated/Models/VolumeMount.cs @@ -0,0 +1,86 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.2.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.ContainerInstance.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.ContainerInstance; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The volume mount. + /// + public partial class VolumeMount + { + /// + /// Initializes a new instance of the VolumeMount class. + /// + public VolumeMount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeMount class. + /// + /// The volume mount name. + /// The path with in the container at which the + /// volume should be mounted. Must not contain ':'. + /// The flag indicating whether the + /// volume mount is read only. + public VolumeMount(string name, string mountPath, bool? readOnlyProperty = default(bool?)) + { + Name = name; + MountPath = mountPath; + ReadOnlyProperty = readOnlyProperty; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the volume mount name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the path with in the container at which the volume + /// should be mounted. Must not contain ':'. + /// + [JsonProperty(PropertyName = "mountPath")] + public string MountPath { get; set; } + + /// + /// Gets or sets the flag indicating whether the volume mount is read + /// only. + /// + [JsonProperty(PropertyName = "readOnly")] + public bool? ReadOnlyProperty { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (MountPath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "MountPath"); + } + } + } +} diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Microsoft.Azure.Management.ContainerInstance.csproj b/src/SDKs/ContainerInstance/Management.ContainerInstance/Microsoft.Azure.Management.ContainerInstance.csproj new file mode 100644 index 000000000000..cd9665c30230 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Microsoft.Azure.Management.ContainerInstance.csproj @@ -0,0 +1,14 @@ + + + + Microsoft Azure Container Instance Management Library + 1.0.0-preview + Microsoft.Azure.Management.ContainerInstance + Microsoft.Azure.Management.ContainerInstance + Microsoft Azure Container Instance Management;Container Instance;REST HTTP client;azureofficial;windowsazureofficial;netcore451511 + http://go.microsoft.com/fwlink/?LinkID=288890 + + + net452;netstandard1.4 + + diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..e4a6df3039d1 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; + +[assembly: AssemblyTitle("Microsoft Azure Container Instance Management Library")] +[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Container Instance.")] + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.2.0.0")] + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/generate.cmd b/src/SDKs/ContainerInstance/Management.ContainerInstance/generate.cmd new file mode 100644 index 000000000000..d3139841b336 --- /dev/null +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/generate.cmd @@ -0,0 +1,7 @@ +:: +:: Microsoft Azure SDK for Net - Generate library code +:: Copyright (C) Microsoft Corporation. All Rights Reserved. +:: + +@echo off +call %~dp0..\..\..\..\tools\generate.cmd containerinstance/resource-manager %* diff --git a/src/SDKs/dirs.proj b/src/SDKs/dirs.proj index 44a87fcb4138..2fc7692442db 100644 --- a/src/SDKs/dirs.proj +++ b/src/SDKs/dirs.proj @@ -11,6 +11,7 @@ + @@ -68,6 +69,7 @@ + From a3d1e26931422848732ecac318435d49e5c03f29 Mon Sep 17 00:00:00 2001 From: Chen Shou Date: Wed, 23 Aug 2017 11:08:08 -0700 Subject: [PATCH 2/3] Revert unnecessary changes and make version consistent --- .../ContainerInstance.Tests/ContainerInstance.Tests.csproj | 4 ---- .../Management.ContainerInstance/Properties/AssemblyInfo.cs | 4 ++-- src/SDKs/dirs.proj | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj b/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj index 10dd08685bef..7ab6bede48ae 100644 --- a/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj @@ -13,10 +13,6 @@ - - diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs index e4a6df3039d1..ff1c7d378bcc 100644 --- a/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ [assembly: AssemblyTitle("Microsoft Azure Container Instance Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Container Instance.")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyFileVersion("1.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/SDKs/dirs.proj b/src/SDKs/dirs.proj index 2fc7692442db..44a87fcb4138 100644 --- a/src/SDKs/dirs.proj +++ b/src/SDKs/dirs.proj @@ -11,7 +11,6 @@ - @@ -69,7 +68,6 @@ - From 0324e8983f6a60ba65c3df8d9779d9e201b508da Mon Sep 17 00:00:00 2001 From: Chen Shou Date: Mon, 28 Aug 2017 11:38:31 -0700 Subject: [PATCH 3/3] remove some unnecessary metadata --- .../ContainerInstance.Tests/ContainerInstance.Tests.csproj | 1 - .../ContainerInstance.Tests/Properties/AssemblyInfo.cs | 5 ----- .../Microsoft.Azure.Management.ContainerInstance.csproj | 1 - .../Management.ContainerInstance/Properties/AssemblyInfo.cs | 3 --- 4 files changed, 10 deletions(-) diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj b/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj index 7ab6bede48ae..9567fe1fa76c 100644 --- a/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/ContainerInstance.Tests.csproj @@ -9,7 +9,6 @@ netcoreapp1.1 - diff --git a/src/SDKs/ContainerInstance/ContainerInstance.Tests/Properties/AssemblyInfo.cs b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Properties/AssemblyInfo.cs index 4a13c1d9a024..2140b5e7e079 100644 --- a/src/SDKs/ContainerInstance/ContainerInstance.Tests/Properties/AssemblyInfo.cs +++ b/src/SDKs/ContainerInstance/ContainerInstance.Tests/Properties/AssemblyInfo.cs @@ -18,11 +18,6 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("80C5B642-F93C-4E68-9B37-04565D3CF6AB")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Microsoft.Azure.Management.ContainerInstance.csproj b/src/SDKs/ContainerInstance/Management.ContainerInstance/Microsoft.Azure.Management.ContainerInstance.csproj index cd9665c30230..f78382f0c4a9 100644 --- a/src/SDKs/ContainerInstance/Management.ContainerInstance/Microsoft.Azure.Management.ContainerInstance.csproj +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Microsoft.Azure.Management.ContainerInstance.csproj @@ -6,7 +6,6 @@ Microsoft.Azure.Management.ContainerInstance Microsoft.Azure.Management.ContainerInstance Microsoft Azure Container Instance Management;Container Instance;REST HTTP client;azureofficial;windowsazureofficial;netcore451511 - http://go.microsoft.com/fwlink/?LinkID=288890 net452;netstandard1.4 diff --git a/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs b/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs index ff1c7d378bcc..9b9d202f8a64 100644 --- a/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs +++ b/src/SDKs/ContainerInstance/Management.ContainerInstance/Properties/AssemblyInfo.cs @@ -7,9 +7,6 @@ [assembly: AssemblyTitle("Microsoft Azure Container Instance Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Container Instance.")] -[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.0.0")] - [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")]