diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/BatchTestHelpers.cs b/src/ResourceManager/Batch/Commands.Batch.Test/BatchTestHelpers.cs index 8bf7040956d3..c01b9dd2415a 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/BatchTestHelpers.cs +++ b/src/ResourceManager/Batch/Commands.Batch.Test/BatchTestHelpers.cs @@ -12,15 +12,23 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using System.Net; +using Microsoft.Azure.Batch.Protocol; +using Microsoft.Azure.Batch.Protocol.Entities; using Microsoft.Azure.Management.Batch.Models; +using System; using System.Collections; using System.Collections.Generic; +using System.Reflection; using Xunit; namespace Microsoft.Azure.Commands.Batch.Test { public static class BatchTestHelpers { + /// + /// Builds an AccountResource object using the specified parameters + /// public static AccountResource CreateAccountResource(string accountName, string resourceGroupName, Hashtable[] tags = null) { string tenantUrlEnding = "batch-test.windows-int.net"; @@ -39,9 +47,28 @@ public static AccountResource CreateAccountResource(string accountName, string r { resource.Tags = Microsoft.Azure.Commands.Batch.Helpers.CreateTagDictionary(tags, true); } + return resource; } + /// + /// Builds a BatchAccountContext object with the keys set for testing + /// + public static BatchAccountContext CreateBatchContextWithKeys() + { + AccountResource resource = CreateAccountResource("account", "resourceGroup"); + BatchAccountContext context = BatchAccountContext.ConvertAccountResourceToNewAccountContext(resource); + string dummyKey = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; + SetProperty(context, "PrimaryAccountKey", dummyKey); + SetProperty(context, "SecondaryAccountKey", dummyKey); + + return context; + } + + + /// + /// Verifies that two BatchAccountContext objects are equal + /// public static void AssertBatchAccountContextsAreEqual(BatchAccountContext context1, BatchAccountContext context2) { if (context1 == null) @@ -67,5 +94,52 @@ public static void AssertBatchAccountContextsAreEqual(BatchAccountContext contex Assert.Equal(context1.TagsTable, context2.TagsTable); Assert.Equal(context1.TaskTenantUrl, context2.TaskTenantUrl); } + + /// + /// Builds a GetWorkItemResponse object + /// + public static GetWorkItemResponse CreateGetWorkItemResponse(string workItemName) + { + GetWorkItemResponse response = new GetWorkItemResponse(); + SetProperty(response, "StatusCode", HttpStatusCode.OK); + + JobExecutionEnvironment jee = new JobExecutionEnvironment(); + + WorkItem workItem = new WorkItem(workItemName, jee); + SetProperty(response, "WorkItem", workItem); + + return response; + } + + /// + /// Builds a ListWorkItemsResponse object + /// + public static ListWorkItemsResponse CreateListWorkItemsResponse(IEnumerable workItemNames) + { + ListWorkItemsResponse response = new ListWorkItemsResponse(); + SetProperty(response, "StatusCode", HttpStatusCode.OK); + + List workItems = new List(); + JobExecutionEnvironment jee = new JobExecutionEnvironment(); + + foreach (string name in workItemNames) + { + workItems.Add(new WorkItem(name, jee)); + } + + SetProperty(response, "WorkItems", workItems); + + return response; + } + + /// + /// Uses Reflection to set a property value on an object. Can be used to bypass restricted set accessors. + /// + private static void SetProperty(object obj, string propertyName, object propertyValue) + { + Type t = obj.GetType(); + PropertyInfo propInfo = t.GetProperty(propertyName); + propInfo.SetValue(obj, propertyValue); + } } } diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj index 38901382309c..5e571e467422 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj +++ b/src/ResourceManager/Batch/Commands.Batch.Test/Commands.Batch.Test.csproj @@ -14,6 +14,7 @@ ..\ true + 49379715 true @@ -38,6 +39,10 @@ false + + False + ..\..\..\packages\Azure.Batch.1.1.0\lib\net45\Microsoft.Azure.Batch.dll + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll @@ -72,6 +77,12 @@ False ..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.5486.28526-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll + + ..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll + + + ..\..\..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll + False ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll @@ -80,6 +91,17 @@ False ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + + ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\packages\WindowsAzure.Storage.2.1.0.4\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + False + ..\..\..\packages\Hydra.SpecTestSupport.1.0.5417.13285-prerelease\lib\net45\Microsoft.WindowsAzure.Testing.dll + False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll @@ -87,9 +109,15 @@ ..\..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll + + False + ..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll + + + False D:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll @@ -105,9 +133,11 @@ ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll - - ..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll + + ..\..\..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll + + False ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll @@ -125,6 +155,7 @@ + @@ -180,6 +211,9 @@ + + + diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs b/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs index fb3848dee18d..b9547d814413 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs +++ b/src/ResourceManager/Batch/Commands.Batch.Test/ScenarioTests/BatchController.cs @@ -19,8 +19,6 @@ using Microsoft.Azure.Management.Resources; using Microsoft.Azure.Test; using Microsoft.WindowsAzure.Commands.ScenarioTest; -using Microsoft.WindowsAzure.Commands.Utilities.Common; -using Microsoft.Azure.Test; using System; using System.Linq; diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/WorkItems/GetBatchWorkItemCommandTests.cs b/src/ResourceManager/Batch/Commands.Batch.Test/WorkItems/GetBatchWorkItemCommandTests.cs new file mode 100644 index 000000000000..97e8daa3f156 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch.Test/WorkItems/GetBatchWorkItemCommandTests.cs @@ -0,0 +1,168 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Batch; +using Microsoft.Azure.Batch.Protocol; +using Microsoft.Azure.Batch.Protocol.Entities; +using Microsoft.Azure.Commands.Batch.Models; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Moq; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Threading.Tasks; +using Xunit; + +namespace Microsoft.Azure.Commands.Batch.Test.WorkItems +{ + public class GetBatchWorkItemCommandTests + { + private GetBatchWorkItemCommand cmdlet; + private Mock batchClientMock; + private Mock commandRuntimeMock; + + public GetBatchWorkItemCommandTests() + { + batchClientMock = new Mock(); + commandRuntimeMock = new Mock(); + cmdlet = new GetBatchWorkItemCommand() + { + CommandRuntime = commandRuntimeMock.Object, + BatchClient = batchClientMock.Object, + }; + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void GetBatchWorkItemTest() + { + // Setup cmdlet to get a WorkItem by name + BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys(); + cmdlet.BatchContext = context; + cmdlet.Name = "testWorkItem"; + cmdlet.Filter = null; + + // Build a WorkItem instead of querying the service on a GetWorkItem call + YieldInjectionInterceptor interceptor = new YieldInjectionInterceptor((opContext, request) => + { + if (request is GetWorkItemRequest) + { + GetWorkItemResponse response = BatchTestHelpers.CreateGetWorkItemResponse(cmdlet.Name); + Task task = Task.Factory.StartNew(() => { return response; }); + return task; + } + return null; + }); + cmdlet.AdditionalBehaviors = new List() { interceptor }; + + // Setup the cmdlet to write pipeline output to a list that can be examined later + List pipeline = new List(); + commandRuntimeMock.Setup(r => r.WriteObject(It.IsAny())).Callback(w => pipeline.Add((PSCloudWorkItem)w)); + + cmdlet.ExecuteCmdlet(); + + // Verify that the cmdlet wrote the WorkItem returned from the OM to the pipeline + Assert.Equal(1, pipeline.Count); + Assert.Equal(cmdlet.Name, pipeline[0].Name); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void ListBatchWorkItemByODataFilterTest() + { + // Setup cmdlet to list WorkItems using an OData filter + BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys(); + cmdlet.BatchContext = context; + cmdlet.Name = null; + cmdlet.Filter = "startswith(name,'test')"; + + string[] namesOfConstructedWorkItems = new[] {"test1", "test2"}; + + // Build some WorkItems instead of querying the service on a ListWorkItems call + YieldInjectionInterceptor interceptor = new YieldInjectionInterceptor((opContext, request) => + { + if (request is ListWorkItemsRequest) + { + ListWorkItemsResponse response = BatchTestHelpers.CreateListWorkItemsResponse(namesOfConstructedWorkItems); + Task task = Task.Factory.StartNew(() => { return response; }); + return task; + } + return null; + }); + cmdlet.AdditionalBehaviors = new List() { interceptor }; + + // Setup the cmdlet to write pipeline output to a list that can be examined later + List> pipeline = new List>(); + commandRuntimeMock.Setup(r => + r.WriteObject(It.IsAny>())) + .Callback(w => pipeline.Add((PSAsyncEnumerable)w)); + + cmdlet.ExecuteCmdlet(); + + // Verify that the cmdlet wrote the enumerator to the pipeline and that it contains the constructed WorkItems + Assert.Equal(1, pipeline.Count); + int workItemCount = 0; + foreach (PSCloudWorkItem w in pipeline[0]) + { + Assert.True(namesOfConstructedWorkItems.Contains(w.Name)); + workItemCount++; + } + Assert.Equal(namesOfConstructedWorkItems.Length, workItemCount); + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void ListBatchWorkItemWithoutFiltersTest() + { + // Setup cmdlet to list WorkItems without filters + BatchAccountContext context = BatchTestHelpers.CreateBatchContextWithKeys(); + cmdlet.BatchContext = context; + cmdlet.Name = null; + cmdlet.Filter = null; + + string[] namesOfConstructedWorkItems = new[] { "name1", "name2", "name3" }; + + // Build some WorkItems instead of querying the service on a ListWorkItems call + YieldInjectionInterceptor interceptor = new YieldInjectionInterceptor((opContext, request) => + { + if (request is ListWorkItemsRequest) + { + ListWorkItemsResponse response = BatchTestHelpers.CreateListWorkItemsResponse(namesOfConstructedWorkItems); + Task task = Task.Factory.StartNew(() => { return response; }); + return task; + } + return null; + }); + cmdlet.AdditionalBehaviors = new List() { interceptor }; + + // Setup the cmdlet to write pipeline output to a list that can be examined later + List> pipeline = new List>(); + commandRuntimeMock.Setup(r => + r.WriteObject(It.IsAny>())) + .Callback(w => pipeline.Add((PSAsyncEnumerable)w)); + + cmdlet.ExecuteCmdlet(); + + // Verify that the cmdlet wrote the enumerator to the pipeline and that it contains the constructed WorkItems + Assert.Equal(1, pipeline.Count); + int workItemCount = 0; + foreach (PSCloudWorkItem w in pipeline[0]) + { + Assert.True(namesOfConstructedWorkItems.Contains(w.Name)); + workItemCount++; + } + Assert.Equal(namesOfConstructedWorkItems.Length, workItemCount); + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/about.txt b/src/ResourceManager/Batch/Commands.Batch.Test/about.txt new file mode 100644 index 000000000000..0ddda9e3821c --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch.Test/about.txt @@ -0,0 +1,18 @@ +This project is divided into Unit Tests and Scenario Tests. +All the Scenario Tests can be found under the ScenarioTests folder. All other test classes are Unit Tests. + +The Unit Tests run in the xUnit test framework. +xUnit Documentation: http://xunit.github.io/ + +The Unit Tests make use of the Moq framework to create mock objects of the PowerShell runtime and the +Hyak management libraries. +Moq Documentation: https://github.com/Moq/moq4/blob/master/README.md + +Unit Tests for cmdlets that use the Batch OM make use of BatchClientBehaviors. +Using this feature, we insert custom behaviors into the OM service requests that allow +us to modify the Batch request objects, the actions performed on them, and their responses. +BatchClientBehaviors Documentation: https://msdn.microsoft.com/en-us/library/azure/microsoft.azure.batch.batchclientbehavior.aspx + +The Scenario Tests make use of the HTTP recorder/playback functionality in the Hyak +management libraries. See the Azure PowerShell Developer Guide for more information: +https://github.com/Azure/azure-powershell/wiki/Microsoft-Azure-PowerShell-Developer-Guide#running-scenario-tests diff --git a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config index 8b73ff7326f8..6c8aec22fc9e 100644 --- a/src/ResourceManager/Batch/Commands.Batch.Test/packages.config +++ b/src/ResourceManager/Batch/Commands.Batch.Test/packages.config @@ -1,5 +1,6 @@  + @@ -13,10 +14,15 @@ + + + + + \ No newline at end of file diff --git a/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs b/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs index 3173556916de..d426512da28d 100644 --- a/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs +++ b/src/ResourceManager/Batch/Commands.Batch/BatchClient.cs @@ -19,8 +19,6 @@ using Microsoft.Azure.Management.Batch; using Microsoft.Azure.Management.Batch.Models; using Microsoft.Azure.Management.Resources; -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.Commands.Common; using System; using System.Collections; using System.Collections.Generic; @@ -44,6 +42,7 @@ public BatchClient() /// Creates new BatchClient instance /// /// The IBatchManagementClient instance + /// The IResourceManagementClient instance public BatchClient(IBatchManagementClient batchManagementClient, IResourceManagementClient resourceManagementClient) { BatchManagementClient = batchManagementClient; @@ -51,9 +50,9 @@ public BatchClient(IBatchManagementClient batchManagementClient, IResourceManage } /// - /// Creates new ResourceManagementClient + /// Creates new BatchClient /// - /// Context with subscription containing a batch account to manipulate + /// Context with subscription containing a batch account to manipulate public BatchClient(AzureContext context) : this(AzureSession.ClientFactory.CreateClient(context, AzureEnvironment.Endpoint.ResourceManager), AzureSession.ClientFactory.CreateClient(context, AzureEnvironment.Endpoint.ResourceManager)) @@ -257,7 +256,7 @@ public virtual AzureOperationResponse DeleteAccount(string resourceGroupName, st /// /// Lists all accounts in a subscription or in a resource group if its name is specified /// - /// Next link to use when querying for accounts + /// Next link to use when querying for accounts /// The status of list operation internal BatchAccountListResponse ListNextAccounts(string NextLink) { diff --git a/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs b/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs index 9b63bdca19a8..cecd0049961f 100644 --- a/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs +++ b/src/ResourceManager/Batch/Commands.Batch/BatchCmdletBase.cs @@ -12,12 +12,15 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.Azure.Batch.Common; +using Microsoft.Azure.Batch.Protocol.Entities; using Hyak.Common; using Microsoft.Azure.Common.Extensions; using Microsoft.WindowsAzure; using Microsoft.WindowsAzure.Commands.Utilities.Common; using Newtonsoft.Json.Linq; using System; +using System.Text; namespace Microsoft.Azure.Commands.Batch { @@ -52,6 +55,30 @@ protected override void ProcessRecord() ExecuteCmdlet(); OnProcessRecord(); } + catch (AggregateException ex) + { + // When the OM encounters an error, it'll throw an AggregateException with a nested BatchException. + // BatchExceptions have special handling to extract detailed failure information. When an AggregateException + // is encountered, loop through the inner exceptions. If there's a nested BatchException, perform the + // special handling. Otherwise, just write out the error. + AggregateException flattened = ex.Flatten(); + foreach (Exception inner in flattened.InnerExceptions) + { + BatchException asBatch = inner as BatchException; + if (asBatch != null) + { + HandleBatchException(asBatch); + } + else + { + WriteExceptionError(inner); + } + } + } + catch (BatchException ex) + { + HandleBatchException(ex); + } catch (CloudException ex) { var updatedEx = ex; @@ -82,6 +109,7 @@ protected override void ProcessRecord() /// internal static string FindDetailedMessage(string content) { + // TODO: Revise after Task 2362107 is completed on the server side string message = null; if (CloudException.IsJson(content)) @@ -117,5 +145,36 @@ internal static string FindDetailedMessage(string content) return message; } + + /// + /// Extracts failure details from the BatchException object to create a more informative error message for the user. + /// + /// The BatchException object + private void HandleBatchException(BatchException ex) + { + if (ex != null) + { + if (ex.RequestInformation != null && ex.RequestInformation.AzureError != null) + { + StringBuilder str = new StringBuilder(ex.Message).AppendLine(); + + str.AppendFormat("Error Code: {0}", ex.RequestInformation.AzureError.Code).AppendLine(); + str.AppendFormat("Error Message: {0}", ex.RequestInformation.AzureError.Message.Value).AppendLine(); + str.AppendFormat("Client Request ID:{0}", ex.RequestInformation.ClientRequestID).AppendLine(); + if (ex.RequestInformation.AzureError.Values != null) + { + foreach (AzureErrorDetail detail in ex.RequestInformation.AzureError.Values) + { + str.AppendFormat("{0}:{1}", detail.Key, detail.Value).AppendLine(); + } + } + WriteExceptionError(new BatchException(ex.RequestInformation, str.ToString(), ex.InnerException)); + } + else + { + WriteExceptionError(ex); + } + } + } } } diff --git a/src/ResourceManager/Batch/Commands.Batch/BatchObjectModelCmdletBase.cs b/src/ResourceManager/Batch/Commands.Batch/BatchObjectModelCmdletBase.cs new file mode 100644 index 000000000000..80184feb22fb --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/BatchObjectModelCmdletBase.cs @@ -0,0 +1,41 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Batch; +using Microsoft.Azure.Commands.Batch.Properties; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Batch +{ + /// + /// Base class for cmdlets that use the Batch OM. + /// + public class BatchObjectModelCmdletBase : BatchCmdletBase + { + /// + /// Collection of custom behaviors to perform on service calls + /// + internal IEnumerable AdditionalBehaviors { get; set; } + + [Parameter(Mandatory = true, ValueFromPipeline = true, HelpMessage = "The Batch account information.")] + [ValidateNotNullOrEmpty] + public BatchAccountContext BatchContext { get; set; } + + protected override void BeginProcessing() + { + WriteVerboseWithTimestamp(Resources.AccountAndKeyInUse, BatchContext.AccountName, BatchContext.KeyInUse); + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj index cd547b4773cf..f1c7e40b9c7b 100644 --- a/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj +++ b/src/ResourceManager/Batch/Commands.Batch/Commands.Batch.csproj @@ -41,6 +41,9 @@ false + + ..\..\..\packages\Azure.Batch.1.1.0\lib\net45\Microsoft.Azure.Batch.dll + ..\..\..\packages\Hyak.Common.1.0.1\lib\portable-net403+win+wpa81\Hyak.Common.dll @@ -69,6 +72,12 @@ ..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.11.10918.1222\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll + + ..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll + + + ..\..\..\packages\Microsoft.Data.OData.5.6.0\lib\net40\Microsoft.Data.OData.dll + False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll @@ -85,12 +94,20 @@ False ..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll + + ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\packages\WindowsAzure.Storage.2.1.0.4\lib\net40\Microsoft.WindowsAzure.Storage.dll + False ..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + False D:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll @@ -106,6 +123,11 @@ ..\..\..\packages\Microsoft.Net.Http.2.2.28\lib\net45\System.Net.Http.Primitives.dll + + ..\..\..\packages\System.Spatial.5.6.0\lib\net40\System.Spatial.dll + + + @@ -117,14 +139,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True True Resources.resx + + diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/BatchAccountContext.cs b/src/ResourceManager/Batch/Commands.Batch/Models/BatchAccountContext.cs index 311dd493c442..cd9eaad03171 100644 --- a/src/ResourceManager/Batch/Commands.Batch/Models/BatchAccountContext.cs +++ b/src/ResourceManager/Batch/Commands.Batch/Models/BatchAccountContext.cs @@ -12,6 +12,8 @@ // limitations under the License. // ---------------------------------------------------------------------------------- +using Microsoft.Azure.Batch; +using Microsoft.Azure.Batch.Auth; using Microsoft.Azure.Commands.Batch.Properties; using Microsoft.Azure.Management.Batch.Models; using System; @@ -24,6 +26,9 @@ namespace Microsoft.Azure.Commands.Batch /// public class BatchAccountContext { + private AccountKeyType keyInUse; + private IBatchClient batchOMClient; + public string Id { get; private set; } public string AccountEndpoint { get; private set; } @@ -51,9 +56,45 @@ public string TagsTable get { return Helpers.FormatTagsTable(Tags); } } - internal BatchAccountContext() { } + public AccountKeyType KeyInUse + { + get { return this.keyInUse; } + set + { + if (value != this.keyInUse) + { + this.batchOMClient.Dispose(); + this.batchOMClient = null; + } + this.keyInUse = value; + } + } + + internal IBatchClient BatchOMClient + { + get + { + if (this.batchOMClient == null) + { + if ((KeyInUse == AccountKeyType.Primary && string.IsNullOrEmpty(PrimaryAccountKey)) || + (KeyInUse == AccountKeyType.Secondary && string.IsNullOrEmpty(SecondaryAccountKey))) + { + throw new InvalidOperationException(string.Format(Resources.KeyNotPresent, KeyInUse)); + } + string key = KeyInUse == AccountKeyType.Primary ? PrimaryAccountKey : SecondaryAccountKey; + BatchCredentials credentials = new BatchCredentials(AccountName, key); + this.batchOMClient = Microsoft.Azure.Batch.BatchClient.Connect(TaskTenantUrl, credentials); + } + return this.batchOMClient; + } + } + + internal BatchAccountContext() + { + this.keyInUse = AccountKeyType.Primary; + } - internal BatchAccountContext(string accountEndpoint) + internal BatchAccountContext(string accountEndpoint) : this() { this.AccountEndpoint = accountEndpoint; } diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSAffinitiyInformation.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSAffinitiyInformation.cs new file mode 100644 index 000000000000..b3d94ab58c07 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSAffinitiyInformation.cs @@ -0,0 +1,63 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSAffinitiyInformation + { + + internal Microsoft.Azure.Batch.AffinityInformation omObject; + + public PSAffinitiyInformation() + { + this.omObject = new Microsoft.Azure.Batch.AffinityInformation(); + } + + internal PSAffinitiyInformation(Microsoft.Azure.Batch.AffinityInformation omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string AffinityId + { + get + { + return this.omObject.AffinityId; + } + set + { + this.omObject.AffinityId = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSAsyncEnumerable.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSAsyncEnumerable.cs new file mode 100644 index 000000000000..5076accc91b7 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSAsyncEnumerable.cs @@ -0,0 +1,121 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Azure.Batch; + +namespace Microsoft.Azure.Commands.Batch.Models +{ + internal class PSAsyncEnumerable : IEnumerableAsyncExtended + where T1 : class + where T2 : class + { + internal IEnumerableAsyncExtended omAsyncEnumerable; + private Func mappingFunction; + + internal PSAsyncEnumerable(IEnumerableAsyncExtended omAsyncEnumerable, Func mappingFunction) + { + if (omAsyncEnumerable == null) + { + throw new ArgumentNullException("omAsyncEnumerable"); + } + this.omAsyncEnumerable = omAsyncEnumerable; + + if (mappingFunction == null) + { + throw new ArgumentNullException("mappingFunction"); + } + this.mappingFunction = mappingFunction; + } + + IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new PSAsyncEnumerator(omAsyncEnumerable.GetAsyncEnumerator(), this.mappingFunction); + } + + // IEnumerable + public IEnumerator GetEnumerator() + { + return new PSAsyncEnumerator(omAsyncEnumerable.GetAsyncEnumerator(), this.mappingFunction); + } + + // IEnumerableAsyncExtended + public IAsyncEnumerator GetAsyncEnumerator() + { + return new PSAsyncEnumerator(omAsyncEnumerable.GetAsyncEnumerator(), this.mappingFunction); + } + } + + internal class PSAsyncEnumerator : IAsyncEnumerator, IEnumerator + where T1 : class + where T2 : class + { + internal IAsyncEnumerator omEnumerator; + private Func mappingFunction; + + internal PSAsyncEnumerator(IAsyncEnumerator omEnumerator, Func mappingFunction) + { + if (omEnumerator == null) + { + throw new ArgumentNullException("omEnumerator"); + } + this.omEnumerator = omEnumerator; + + if (mappingFunction == null) + { + throw new ArgumentNullException("mappingFunction"); + } + this.mappingFunction = mappingFunction; + } + + object System.Collections.IEnumerator.Current + { + get + { + return this.Current; + } + } + + public T1 Current + { + get + { + return this.mappingFunction(this.omEnumerator.Current); + } + } + + public bool MoveNext() + { + return ((IEnumerator)this.omEnumerator).MoveNext(); + } + + public Task MoveNextAsync() + { + return this.omEnumerator.MoveNextAsync(); + } + + public void Reset() + { + this.omEnumerator.Reset(); + } + + public void Dispose() + { + this.omEnumerator.Dispose(); + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoPoolSpecification.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoPoolSpecification.cs new file mode 100644 index 000000000000..62caede1dbda --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoPoolSpecification.cs @@ -0,0 +1,114 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSAutoPoolSpecification + { + + internal Microsoft.Azure.Batch.IAutoPoolSpecification omObject; + + private PSPoolSpecification poolSpecification; + + public PSAutoPoolSpecification() + { + this.omObject = new Microsoft.Azure.Batch.AutoPoolSpecification(); + } + + internal PSAutoPoolSpecification(Microsoft.Azure.Batch.IAutoPoolSpecification omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string AutoPoolNamePrefix + { + get + { + return this.omObject.AutoPoolNamePrefix; + } + set + { + this.omObject.AutoPoolNamePrefix = value; + } + } + + public System.Boolean? KeepAlive + { + get + { + return this.omObject.KeepAlive; + } + set + { + this.omObject.KeepAlive = value; + } + } + + public PSPoolSpecification PoolSpecification + { + get + { + if (((this.poolSpecification == null) + && (this.omObject.PoolSpecification != null))) + { + this.poolSpecification = new PSPoolSpecification(this.omObject.PoolSpecification); + } + return this.poolSpecification; + } + set + { + if ((value == null)) + { + this.omObject.PoolSpecification = null; + } + else + { + this.omObject.PoolSpecification = value.omObject; + } + this.poolSpecification = value; + } + } + + public Microsoft.Azure.Batch.Common.PoolLifeTimeOption PoolLifeTimeOption + { + get + { + return this.omObject.PoolLifeTimeOption; + } + set + { + this.omObject.PoolLifeTimeOption = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoScaleRun.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoScaleRun.cs new file mode 100644 index 000000000000..25544aca23cf --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoScaleRun.cs @@ -0,0 +1,77 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSAutoScaleRun + { + + internal Microsoft.Azure.Batch.AutoScaleRun omObject; + + private PSAutoScaleRunError error; + + internal PSAutoScaleRun(Microsoft.Azure.Batch.AutoScaleRun omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime Timestamp + { + get + { + return this.omObject.Timestamp; + } + } + + public string Results + { + get + { + return this.omObject.Results; + } + } + + public PSAutoScaleRunError Error + { + get + { + if (((this.error == null) + && (this.omObject.Error != null))) + { + this.error = new PSAutoScaleRunError(this.omObject.Error); + } + return this.error; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoScaleRunError.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoScaleRunError.cs new file mode 100644 index 000000000000..caa4aeda555f --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSAutoScaleRunError.cs @@ -0,0 +1,87 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSAutoScaleRunError + { + + internal Microsoft.Azure.Batch.AutoScaleRunError omObject; + + private IEnumerable values; + + internal PSAutoScaleRunError(Microsoft.Azure.Batch.AutoScaleRunError omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Code + { + get + { + return this.omObject.Code; + } + } + + public string Message + { + get + { + return this.omObject.Message; + } + } + + public IEnumerable Values + { + get + { + if (((this.values == null) + && (this.omObject.Values != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.Values.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSNameValuePair(enumerator.Current)); + } + this.values = list; + } + return this.values; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSCertificateReference.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSCertificateReference.cs new file mode 100644 index 000000000000..ce6b16120be8 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSCertificateReference.cs @@ -0,0 +1,111 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSCertificateReference + { + + internal Microsoft.Azure.Batch.ICertificateReference omObject; + + public PSCertificateReference() + { + this.omObject = new Microsoft.Azure.Batch.CertificateReference(); + } + + internal PSCertificateReference(Microsoft.Azure.Batch.ICertificateReference omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public Microsoft.Azure.Batch.Common.CertStoreLocation StoreLocation + { + get + { + return this.omObject.StoreLocation; + } + set + { + this.omObject.StoreLocation = value; + } + } + + public string StoreName + { + get + { + return this.omObject.StoreName; + } + set + { + this.omObject.StoreName = value; + } + } + + public string Thumbprint + { + get + { + return this.omObject.Thumbprint; + } + set + { + this.omObject.Thumbprint = value; + } + } + + public string ThumbprintAlgorithm + { + get + { + return this.omObject.ThumbprintAlgorithm; + } + set + { + this.omObject.ThumbprintAlgorithm = value; + } + } + + public Microsoft.Azure.Batch.Common.CertVisibility Visibility + { + get + { + return this.omObject.Visibility; + } + set + { + this.omObject.Visibility = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudJob.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudJob.cs new file mode 100644 index 000000000000..10980f76d6c4 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudJob.cs @@ -0,0 +1,226 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSCloudJob + { + + internal Microsoft.Azure.Batch.ICloudJob omObject; + + private PSJobExecutionInformation executionInformation; + + private PSJobConstraints jobConstraints; + + private PSJobManager jobManager; + + private PSJobStatistics statistics; + + internal PSCloudJob(Microsoft.Azure.Batch.ICloudJob omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime CreationTime + { + get + { + return this.omObject.CreationTime; + } + } + + public PSJobExecutionInformation ExecutionInformation + { + get + { + if (((this.executionInformation == null) + && (this.omObject.ExecutionInformation != null))) + { + this.executionInformation = new PSJobExecutionInformation(this.omObject.ExecutionInformation); + } + return this.executionInformation; + } + } + + public PSJobConstraints JobConstraints + { + get + { + if (((this.jobConstraints == null) + && (this.omObject.JobConstraints != null))) + { + this.jobConstraints = new PSJobConstraints(this.omObject.JobConstraints); + } + return this.jobConstraints; + } + set + { + if ((value == null)) + { + this.omObject.JobConstraints = null; + } + else + { + this.omObject.JobConstraints = value.omObject; + } + this.jobConstraints = value; + } + } + + public PSJobManager JobManager + { + get + { + if (((this.jobManager == null) + && (this.omObject.JobManager != null))) + { + this.jobManager = new PSJobManager(this.omObject.JobManager); + } + return this.jobManager; + } + } + + public System.Boolean? KeepAlive + { + get + { + return this.omObject.KeepAlive; + } + set + { + this.omObject.KeepAlive = value; + } + } + + public System.DateTime LastModified + { + get + { + return this.omObject.LastModified; + } + } + + public string Name + { + get + { + return this.omObject.Name; + } + } + + public Microsoft.Azure.Batch.Common.PoolLifeTimeOption PoolLifeTimeOption + { + get + { + return this.omObject.PoolLifeTimeOption; + } + } + + public string PoolName + { + get + { + return this.omObject.PoolName; + } + set + { + this.omObject.PoolName = value; + } + } + + public Microsoft.Azure.Batch.Common.JobState PreviousState + { + get + { + return this.omObject.PreviousState; + } + } + + public System.DateTime? PreviousStateTransitionTime + { + get + { + return this.omObject.PreviousStateTransitionTime; + } + } + + public System.Int32? Priority + { + get + { + return this.omObject.Priority; + } + set + { + this.omObject.Priority = value; + } + } + + public Microsoft.Azure.Batch.Common.JobState State + { + get + { + return this.omObject.State; + } + } + + public System.DateTime StateTransitionTime + { + get + { + return this.omObject.StateTransitionTime; + } + } + + public PSJobStatistics Statistics + { + get + { + if (((this.statistics == null) + && (this.omObject.Statistics != null))) + { + this.statistics = new PSJobStatistics(this.omObject.Statistics); + } + return this.statistics; + } + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudPool.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudPool.cs new file mode 100644 index 000000000000..29b9ecb52625 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudPool.cs @@ -0,0 +1,411 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSCloudPool + { + + internal Microsoft.Azure.Batch.ICloudPool omObject; + + private PSAutoScaleRun autoScaleRun; + + private IList certificateReferences; + + private IList metadata; + + private PSResizeError resizeError; + + private PSSchedulingPolicy schedulingPolicy; + + private PSStartTask startTask; + + private PSPoolStatistics statistics; + + internal PSCloudPool(Microsoft.Azure.Batch.ICloudPool omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public Microsoft.Azure.Batch.Common.AllocationState AllocationState + { + get + { + return this.omObject.AllocationState; + } + } + + public System.DateTime? AllocationStateTransitionTime + { + get + { + return this.omObject.AllocationStateTransitionTime; + } + } + + public string AutoScaleFormula + { + get + { + return this.omObject.AutoScaleFormula; + } + set + { + this.omObject.AutoScaleFormula = value; + } + } + + public PSAutoScaleRun AutoScaleRun + { + get + { + if (((this.autoScaleRun == null) + && (this.omObject.AutoScaleRun != null))) + { + this.autoScaleRun = new PSAutoScaleRun(this.omObject.AutoScaleRun); + } + return this.autoScaleRun; + } + } + + public IList CertificateReferences + { + get + { + if (((this.certificateReferences == null) + && (this.omObject.CertificateReferences != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.CertificateReferences.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSCertificateReference(enumerator.Current)); + } + this.certificateReferences = list; + } + return this.certificateReferences; + } + set + { + if ((value == null)) + { + this.omObject.CertificateReferences = null; + } + else + { + this.omObject.CertificateReferences = new List(); + } + this.certificateReferences = value; + } + } + + public System.Boolean? Communication + { + get + { + return this.omObject.Communication; + } + set + { + this.omObject.Communication = value; + } + } + + public System.DateTime CreationTime + { + get + { + return this.omObject.CreationTime; + } + } + + public System.Int32? CurrentDedicated + { + get + { + return this.omObject.CurrentDedicated; + } + } + + public string CurrentOSVersion + { + get + { + return this.omObject.CurrentOSVersion; + } + } + + public System.Boolean? AutoScaleEnabled + { + get + { + return this.omObject.AutoScaleEnabled; + } + set + { + this.omObject.AutoScaleEnabled = value; + } + } + + public System.DateTime LastModified + { + get + { + return this.omObject.LastModified; + } + } + + public System.Int32? MaxTasksPerVM + { + get + { + return this.omObject.MaxTasksPerVM; + } + set + { + this.omObject.MaxTasksPerVM = value; + } + } + + public IList Metadata + { + get + { + if (((this.metadata == null) + && (this.omObject.Metadata != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.Metadata.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSMetadataItem(enumerator.Current)); + } + this.metadata = list; + } + return this.metadata; + } + set + { + if ((value == null)) + { + this.omObject.Metadata = null; + } + else + { + this.omObject.Metadata = new List(); + } + this.metadata = value; + } + } + + public string Name + { + get + { + return this.omObject.Name; + } + set + { + this.omObject.Name = value; + } + } + + public string OSFamily + { + get + { + return this.omObject.OSFamily; + } + set + { + this.omObject.OSFamily = value; + } + } + + public PSResizeError ResizeError + { + get + { + if (((this.resizeError == null) + && (this.omObject.ResizeError != null))) + { + this.resizeError = new PSResizeError(this.omObject.ResizeError); + } + return this.resizeError; + } + } + + public System.TimeSpan? ResizeTimeout + { + get + { + return this.omObject.ResizeTimeout; + } + set + { + this.omObject.ResizeTimeout = value; + } + } + + public PSSchedulingPolicy SchedulingPolicy + { + get + { + if (((this.schedulingPolicy == null) + && (this.omObject.SchedulingPolicy != null))) + { + this.schedulingPolicy = new PSSchedulingPolicy(this.omObject.SchedulingPolicy); + } + return this.schedulingPolicy; + } + set + { + if ((value == null)) + { + this.omObject.SchedulingPolicy = null; + } + else + { + this.omObject.SchedulingPolicy = value.omObject; + } + this.schedulingPolicy = value; + } + } + + public PSStartTask StartTask + { + get + { + if (((this.startTask == null) + && (this.omObject.StartTask != null))) + { + this.startTask = new PSStartTask(this.omObject.StartTask); + } + return this.startTask; + } + set + { + if ((value == null)) + { + this.omObject.StartTask = null; + } + else + { + this.omObject.StartTask = value.omObject; + } + this.startTask = value; + } + } + + public Microsoft.Azure.Batch.Common.PoolState State + { + get + { + return this.omObject.State; + } + } + + public System.DateTime StateTransitionTime + { + get + { + return this.omObject.StateTransitionTime; + } + } + + public PSPoolStatistics Statistics + { + get + { + if (((this.statistics == null) + && (this.omObject.Statistics != null))) + { + this.statistics = new PSPoolStatistics(this.omObject.Statistics); + } + return this.statistics; + } + } + + public System.Int32? TargetDedicated + { + get + { + return this.omObject.TargetDedicated; + } + set + { + this.omObject.TargetDedicated = value; + } + } + + public string TargetOSVersion + { + get + { + return this.omObject.TargetOSVersion; + } + set + { + this.omObject.TargetOSVersion = value; + } + } + + public string VMSize + { + get + { + return this.omObject.VMSize; + } + set + { + this.omObject.VMSize = value; + } + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudTask.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudTask.cs new file mode 100644 index 000000000000..2a26501086c6 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudTask.cs @@ -0,0 +1,316 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSCloudTask + { + + internal Microsoft.Azure.Batch.ICloudTask omObject; + + private PSAffinitiyInformation affinityInformation; + + private IList environmentSettings; + + private PSTaskExecutionInformation executionInformation; + + private PSTaskStatistics statistics; + + private PSTaskConstraints taskConstraints; + + private PSVMInformation vMInformation; + + private IList resourceFiles; + + public PSCloudTask(string name, string commandline) + { + this.omObject = new Microsoft.Azure.Batch.CloudTask(name, commandline); + } + + internal PSCloudTask(Microsoft.Azure.Batch.ICloudTask omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public PSAffinitiyInformation AffinityInformation + { + get + { + if (((this.affinityInformation == null) + && (this.omObject.AffinityInformation != null))) + { + this.affinityInformation = new PSAffinitiyInformation(this.omObject.AffinityInformation); + } + return this.affinityInformation; + } + set + { + if ((value == null)) + { + this.omObject.AffinityInformation = null; + } + else + { + this.omObject.AffinityInformation = value.omObject; + } + this.affinityInformation = value; + } + } + + public string CommandLine + { + get + { + return this.omObject.CommandLine; + } + set + { + this.omObject.CommandLine = value; + } + } + + public System.DateTime CreationTime + { + get + { + return this.omObject.CreationTime; + } + } + + public IList EnvironmentSettings + { + get + { + if (((this.environmentSettings == null) + && (this.omObject.EnvironmentSettings != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.EnvironmentSettings.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSEnvironmentSetting(enumerator.Current)); + } + this.environmentSettings = list; + } + return this.environmentSettings; + } + set + { + if ((value == null)) + { + this.omObject.EnvironmentSettings = null; + } + else + { + this.omObject.EnvironmentSettings = new List(); + } + this.environmentSettings = value; + } + } + + public PSTaskExecutionInformation ExecutionInformation + { + get + { + if (((this.executionInformation == null) + && (this.omObject.ExecutionInformation != null))) + { + this.executionInformation = new PSTaskExecutionInformation(this.omObject.ExecutionInformation); + } + return this.executionInformation; + } + } + + public System.DateTime LastModified + { + get + { + return this.omObject.LastModified; + } + } + + public string Name + { + get + { + return this.omObject.Name; + } + set + { + this.omObject.Name = value; + } + } + + public Microsoft.Azure.Batch.Common.TaskState PreviousState + { + get + { + return this.omObject.PreviousState; + } + } + + public System.DateTime? PreviousStateTransitionTime + { + get + { + return this.omObject.PreviousStateTransitionTime; + } + } + + public System.Boolean? RunElevated + { + get + { + return this.omObject.RunElevated; + } + set + { + this.omObject.RunElevated = value; + } + } + + public Microsoft.Azure.Batch.Common.TaskState State + { + get + { + return this.omObject.State; + } + } + + public System.DateTime StateTransitionTime + { + get + { + return this.omObject.StateTransitionTime; + } + } + + public PSTaskStatistics Statistics + { + get + { + if (((this.statistics == null) + && (this.omObject.Statistics != null))) + { + this.statistics = new PSTaskStatistics(this.omObject.Statistics); + } + return this.statistics; + } + } + + public PSTaskConstraints TaskConstraints + { + get + { + if (((this.taskConstraints == null) + && (this.omObject.TaskConstraints != null))) + { + this.taskConstraints = new PSTaskConstraints(this.omObject.TaskConstraints); + } + return this.taskConstraints; + } + set + { + if ((value == null)) + { + this.omObject.TaskConstraints = null; + } + else + { + this.omObject.TaskConstraints = value.omObject; + } + this.taskConstraints = value; + } + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + + public PSVMInformation VMInformation + { + get + { + if (((this.vMInformation == null) + && (this.omObject.VMInformation != null))) + { + this.vMInformation = new PSVMInformation(this.omObject.VMInformation); + } + return this.vMInformation; + } + } + + public IList ResourceFiles + { + get + { + if (((this.resourceFiles == null) + && (this.omObject.ResourceFiles != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.ResourceFiles.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSResourceFile(enumerator.Current)); + } + this.resourceFiles = list; + } + return this.resourceFiles; + } + set + { + if ((value == null)) + { + this.omObject.ResourceFiles = null; + } + else + { + this.omObject.ResourceFiles = new List(); + } + this.resourceFiles = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudWorkItem.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudWorkItem.cs new file mode 100644 index 000000000000..5aee50e05d46 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSCloudWorkItem.cs @@ -0,0 +1,262 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSCloudWorkItem + { + + internal Microsoft.Azure.Batch.ICloudWorkItem omObject; + + private PSWorkItemExecutionInformation executionInformation; + + private PSJobExecutionEnvironment jobExecutionEnvironment; + + private PSJobSpecification jobSpecification; + + private IList metadata; + + private PSWorkItemSchedule schedule; + + private PSWorkItemStatistics statistics; + + internal PSCloudWorkItem(Microsoft.Azure.Batch.ICloudWorkItem omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime CreationTime + { + get + { + return this.omObject.CreationTime; + } + } + + public PSWorkItemExecutionInformation ExecutionInformation + { + get + { + if (((this.executionInformation == null) + && (this.omObject.ExecutionInformation != null))) + { + this.executionInformation = new PSWorkItemExecutionInformation(this.omObject.ExecutionInformation); + } + return this.executionInformation; + } + } + + public PSJobExecutionEnvironment JobExecutionEnvironment + { + get + { + if (((this.jobExecutionEnvironment == null) + && (this.omObject.JobExecutionEnvironment != null))) + { + this.jobExecutionEnvironment = new PSJobExecutionEnvironment(this.omObject.JobExecutionEnvironment); + } + return this.jobExecutionEnvironment; + } + set + { + if ((value == null)) + { + this.omObject.JobExecutionEnvironment = null; + } + else + { + this.omObject.JobExecutionEnvironment = value.omObject; + } + this.jobExecutionEnvironment = value; + } + } + + public PSJobSpecification JobSpecification + { + get + { + if (((this.jobSpecification == null) + && (this.omObject.JobSpecification != null))) + { + this.jobSpecification = new PSJobSpecification(this.omObject.JobSpecification); + } + return this.jobSpecification; + } + set + { + if ((value == null)) + { + this.omObject.JobSpecification = null; + } + else + { + this.omObject.JobSpecification = value.omObject; + } + this.jobSpecification = value; + } + } + + public System.DateTime? LastModified + { + get + { + return this.omObject.LastModified; + } + } + + public IList Metadata + { + get + { + if (((this.metadata == null) + && (this.omObject.Metadata != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.Metadata.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSMetadataItem(enumerator.Current)); + } + this.metadata = list; + } + return this.metadata; + } + set + { + if ((value == null)) + { + this.omObject.Metadata = null; + } + else + { + this.omObject.Metadata = new List(); + } + this.metadata = value; + } + } + + public string Name + { + get + { + return this.omObject.Name; + } + set + { + this.omObject.Name = value; + } + } + + public Microsoft.Azure.Batch.Common.WorkItemState PreviousState + { + get + { + return this.omObject.PreviousState; + } + } + + public System.DateTime? PreviousStateTransitionTime + { + get + { + return this.omObject.PreviousStateTransitionTime; + } + } + + public PSWorkItemSchedule Schedule + { + get + { + if (((this.schedule == null) + && (this.omObject.Schedule != null))) + { + this.schedule = new PSWorkItemSchedule(this.omObject.Schedule); + } + return this.schedule; + } + set + { + if ((value == null)) + { + this.omObject.Schedule = null; + } + else + { + this.omObject.Schedule = value.omObject; + } + this.schedule = value; + } + } + + public Microsoft.Azure.Batch.Common.WorkItemState State + { + get + { + return this.omObject.State; + } + } + + public System.DateTime StateTransitionTime + { + get + { + return this.omObject.StateTransitionTime; + } + } + + public PSWorkItemStatistics Statistics + { + get + { + if (((this.statistics == null) + && (this.omObject.Statistics != null))) + { + this.statistics = new PSWorkItemStatistics(this.omObject.Statistics); + } + return this.statistics; + } + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSEnvironmentSetting.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSEnvironmentSetting.cs new file mode 100644 index 000000000000..7fb7888a3233 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSEnvironmentSetting.cs @@ -0,0 +1,67 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSEnvironmentSetting + { + + internal Microsoft.Azure.Batch.IEnvironmentSetting omObject; + + public PSEnvironmentSetting(string name, string value) + { + this.omObject = new Microsoft.Azure.Batch.EnvironmentSetting(name, value); + } + + internal PSEnvironmentSetting(Microsoft.Azure.Batch.IEnvironmentSetting omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Name + { + get + { + return this.omObject.Name; + } + } + + public string Value + { + get + { + return this.omObject.Value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSFileProperties.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSFileProperties.cs new file mode 100644 index 000000000000..e48630647306 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSFileProperties.cs @@ -0,0 +1,78 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSFileProperties + { + + internal Microsoft.Azure.Batch.FileProperties omObject; + + internal PSFileProperties(Microsoft.Azure.Batch.FileProperties omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime CreationTime + { + get + { + return this.omObject.CreationTime; + } + } + + public System.DateTime LastModified + { + get + { + return this.omObject.LastModified; + } + } + + public long ContentLength + { + get + { + return this.omObject.ContentLength; + } + } + + public string ContentType + { + get + { + return this.omObject.ContentType; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSJobConstraints.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobConstraints.cs new file mode 100644 index 000000000000..fafc40e153b2 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobConstraints.cs @@ -0,0 +1,62 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSJobConstraints + { + + internal Microsoft.Azure.Batch.JobConstraints omObject; + + internal PSJobConstraints(Microsoft.Azure.Batch.JobConstraints omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.TimeSpan? MaxWallClockTime + { + get + { + return this.omObject.MaxWallClockTime; + } + } + + public System.Int32? MaxTaskRetryCount + { + get + { + return this.omObject.MaxTaskRetryCount; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSJobExecutionEnvironment.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobExecutionEnvironment.cs new file mode 100644 index 000000000000..d488bd4d6d95 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobExecutionEnvironment.cs @@ -0,0 +1,90 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSJobExecutionEnvironment + { + + internal Microsoft.Azure.Batch.IJobExecutionEnvironment omObject; + + private PSAutoPoolSpecification autoPoolSpecification; + + public PSJobExecutionEnvironment() + { + this.omObject = new Microsoft.Azure.Batch.JobExecutionEnvironment(); + } + + internal PSJobExecutionEnvironment(Microsoft.Azure.Batch.IJobExecutionEnvironment omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public PSAutoPoolSpecification AutoPoolSpecification + { + get + { + if (((this.autoPoolSpecification == null) + && (this.omObject.AutoPoolSpecification != null))) + { + this.autoPoolSpecification = new PSAutoPoolSpecification(this.omObject.AutoPoolSpecification); + } + return this.autoPoolSpecification; + } + set + { + if ((value == null)) + { + this.omObject.AutoPoolSpecification = null; + } + else + { + this.omObject.AutoPoolSpecification = value.omObject; + } + this.autoPoolSpecification = value; + } + } + + public string PoolName + { + get + { + return this.omObject.PoolName; + } + set + { + this.omObject.PoolName = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSJobExecutionInformation.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobExecutionInformation.cs new file mode 100644 index 000000000000..516ede53af1c --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobExecutionInformation.cs @@ -0,0 +1,85 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSJobExecutionInformation + { + + internal Microsoft.Azure.Batch.JobExecutionInformation omObject; + + private PSJobSchedulingError schedulingError; + + internal PSJobExecutionInformation(Microsoft.Azure.Batch.JobExecutionInformation omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime? EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public PSJobSchedulingError SchedulingError + { + get + { + if (((this.schedulingError == null) + && (this.omObject.SchedulingError != null))) + { + this.schedulingError = new PSJobSchedulingError(this.omObject.SchedulingError); + } + return this.schedulingError; + } + } + + public string TerminateReason + { + get + { + return this.omObject.TerminateReason; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSJobManager.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobManager.cs new file mode 100644 index 000000000000..2f4a95fe9727 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobManager.cs @@ -0,0 +1,212 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSJobManager + { + + internal Microsoft.Azure.Batch.IJobManager omObject; + + private IList resourceFiles; + + private IList environmentSettings; + + private PSTaskConstraints taskConstraints; + + public PSJobManager() + { + this.omObject = new Microsoft.Azure.Batch.JobManager(); + } + + internal PSJobManager(Microsoft.Azure.Batch.IJobManager omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Name + { + get + { + return this.omObject.Name; + } + set + { + this.omObject.Name = value; + } + } + + public string CommandLine + { + get + { + return this.omObject.CommandLine; + } + set + { + this.omObject.CommandLine = value; + } + } + + public IList ResourceFiles + { + get + { + if (((this.resourceFiles == null) + && (this.omObject.ResourceFiles != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.ResourceFiles.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSResourceFile(enumerator.Current)); + } + this.resourceFiles = list; + } + return this.resourceFiles; + } + set + { + if ((value == null)) + { + this.omObject.ResourceFiles = null; + } + else + { + this.omObject.ResourceFiles = new List(); + } + this.resourceFiles = value; + } + } + + public IList EnvironmentSettings + { + get + { + if (((this.environmentSettings == null) + && (this.omObject.EnvironmentSettings != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.EnvironmentSettings.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSEnvironmentSetting(enumerator.Current)); + } + this.environmentSettings = list; + } + return this.environmentSettings; + } + set + { + if ((value == null)) + { + this.omObject.EnvironmentSettings = null; + } + else + { + this.omObject.EnvironmentSettings = new List(); + } + this.environmentSettings = value; + } + } + + public System.Boolean? RunElevated + { + get + { + return this.omObject.RunElevated; + } + set + { + this.omObject.RunElevated = value; + } + } + + public System.Boolean? RunExclusive + { + get + { + return this.omObject.RunExclusive; + } + set + { + this.omObject.RunExclusive = value; + } + } + + public PSTaskConstraints TaskConstraints + { + get + { + if (((this.taskConstraints == null) + && (this.omObject.TaskConstraints != null))) + { + this.taskConstraints = new PSTaskConstraints(this.omObject.TaskConstraints); + } + return this.taskConstraints; + } + set + { + if ((value == null)) + { + this.omObject.TaskConstraints = null; + } + else + { + this.omObject.TaskConstraints = value.omObject; + } + this.taskConstraints = value; + } + } + + public System.Boolean? KillJobOnCompletion + { + get + { + return this.omObject.KillJobOnCompletion; + } + set + { + this.omObject.KillJobOnCompletion = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSJobSchedulingError.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobSchedulingError.cs new file mode 100644 index 000000000000..bc283d920186 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobSchedulingError.cs @@ -0,0 +1,95 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSJobSchedulingError + { + + internal Microsoft.Azure.Batch.JobSchedulingError omObject; + + private IEnumerable details; + + internal PSJobSchedulingError(Microsoft.Azure.Batch.JobSchedulingError omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public Microsoft.Azure.Batch.Common.SchedulingErrorCategory Category + { + get + { + return this.omObject.Category; + } + } + + public string Code + { + get + { + return this.omObject.Code; + } + } + + public string Message + { + get + { + return this.omObject.Message; + } + } + + public IEnumerable Details + { + get + { + if (((this.details == null) + && (this.omObject.Details != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.Details.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSNameValuePair(enumerator.Current)); + } + this.details = list; + } + return this.details; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSJobSpecification.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobSpecification.cs new file mode 100644 index 000000000000..bcf920d23f4f --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobSpecification.cs @@ -0,0 +1,117 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSJobSpecification + { + + internal Microsoft.Azure.Batch.IJobSpecification omObject; + + private PSJobConstraints jobConstraints; + + private PSJobManager jobManager; + + public PSJobSpecification() + { + this.omObject = new Microsoft.Azure.Batch.JobSpecification(); + } + + internal PSJobSpecification(Microsoft.Azure.Batch.IJobSpecification omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public PSJobConstraints JobConstraints + { + get + { + if (((this.jobConstraints == null) + && (this.omObject.JobConstraints != null))) + { + this.jobConstraints = new PSJobConstraints(this.omObject.JobConstraints); + } + return this.jobConstraints; + } + set + { + if ((value == null)) + { + this.omObject.JobConstraints = null; + } + else + { + this.omObject.JobConstraints = value.omObject; + } + this.jobConstraints = value; + } + } + + public PSJobManager JobManager + { + get + { + if (((this.jobManager == null) + && (this.omObject.JobManager != null))) + { + this.jobManager = new PSJobManager(this.omObject.JobManager); + } + return this.jobManager; + } + set + { + if ((value == null)) + { + this.omObject.JobManager = null; + } + else + { + this.omObject.JobManager = value.omObject; + } + this.jobManager = value; + } + } + + public System.Int32? Priority + { + get + { + return this.omObject.Priority; + } + set + { + this.omObject.Priority = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSJobStatistics.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobStatistics.cs new file mode 100644 index 000000000000..9399d03e15e7 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSJobStatistics.cs @@ -0,0 +1,158 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSJobStatistics + { + + internal Microsoft.Azure.Batch.JobStatistics omObject; + + internal PSJobStatistics(Microsoft.Azure.Batch.JobStatistics omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + + public System.DateTime StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public System.TimeSpan UserCPUTime + { + get + { + return this.omObject.UserCPUTime; + } + } + + public System.TimeSpan KernelCPUTime + { + get + { + return this.omObject.KernelCPUTime; + } + } + + public System.TimeSpan WallClockTime + { + get + { + return this.omObject.WallClockTime; + } + } + + public long ReadIOps + { + get + { + return this.omObject.ReadIOps; + } + } + + public long WriteIOps + { + get + { + return this.omObject.WriteIOps; + } + } + + public long ReadIOBytes + { + get + { + return this.omObject.ReadIOBytes; + } + } + + public long WriteIOBytes + { + get + { + return this.omObject.WriteIOBytes; + } + } + + public long NumSucceededTasks + { + get + { + return this.omObject.NumSucceededTasks; + } + } + + public long NumFailedTasks + { + get + { + return this.omObject.NumFailedTasks; + } + } + + public long NumRetries + { + get + { + return this.omObject.NumRetries; + } + } + + public System.TimeSpan WaitTime + { + get + { + return this.omObject.WaitTime; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSMetadataItem.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSMetadataItem.cs new file mode 100644 index 000000000000..e1b8669d545d --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSMetadataItem.cs @@ -0,0 +1,67 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSMetadataItem + { + + internal Microsoft.Azure.Batch.IMetadataItem omObject; + + public PSMetadataItem(string name, string value) + { + this.omObject = new Microsoft.Azure.Batch.MetadataItem(name, value); + } + + internal PSMetadataItem(Microsoft.Azure.Batch.IMetadataItem omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Name + { + get + { + return this.omObject.Name; + } + } + + public string Value + { + get + { + return this.omObject.Value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSNameValuePair.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSNameValuePair.cs new file mode 100644 index 000000000000..af2328e2d779 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSNameValuePair.cs @@ -0,0 +1,62 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSNameValuePair + { + + internal Microsoft.Azure.Batch.NameValuePair omObject; + + internal PSNameValuePair(Microsoft.Azure.Batch.NameValuePair omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Name + { + get + { + return this.omObject.Name; + } + } + + public string Value + { + get + { + return this.omObject.Value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSPoolSpecification.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSPoolSpecification.cs new file mode 100644 index 000000000000..415e2733fd1d --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSPoolSpecification.cs @@ -0,0 +1,287 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSPoolSpecification + { + + internal Microsoft.Azure.Batch.IPoolSpecification omObject; + + private IList certificateReferences; + + private IList metadata; + + private PSSchedulingPolicy schedulingPolicy; + + private PSStartTask startTask; + + public PSPoolSpecification() + { + this.omObject = new Microsoft.Azure.Batch.PoolSpecification(); + } + + internal PSPoolSpecification(Microsoft.Azure.Batch.IPoolSpecification omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string AutoScaleFormula + { + get + { + return this.omObject.AutoScaleFormula; + } + set + { + this.omObject.AutoScaleFormula = value; + } + } + + public IList CertificateReferences + { + get + { + if (((this.certificateReferences == null) + && (this.omObject.CertificateReferences != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.CertificateReferences.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSCertificateReference(enumerator.Current)); + } + this.certificateReferences = list; + } + return this.certificateReferences; + } + set + { + if ((value == null)) + { + this.omObject.CertificateReferences = null; + } + else + { + this.omObject.CertificateReferences = new List(); + } + this.certificateReferences = value; + } + } + + public System.Boolean? Communication + { + get + { + return this.omObject.Communication; + } + set + { + this.omObject.Communication = value; + } + } + + public System.Boolean? EnableAutoScale + { + get + { + return this.omObject.EnableAutoScale; + } + set + { + this.omObject.EnableAutoScale = value; + } + } + + public System.Int32? MaxTasksPerVM + { + get + { + return this.omObject.MaxTasksPerVM; + } + set + { + this.omObject.MaxTasksPerVM = value; + } + } + + public IList Metadata + { + get + { + if (((this.metadata == null) + && (this.omObject.Metadata != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.Metadata.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSMetadataItem(enumerator.Current)); + } + this.metadata = list; + } + return this.metadata; + } + set + { + if ((value == null)) + { + this.omObject.Metadata = null; + } + else + { + this.omObject.Metadata = new List(); + } + this.metadata = value; + } + } + + public string OSFamily + { + get + { + return this.omObject.OSFamily; + } + set + { + this.omObject.OSFamily = value; + } + } + + public System.TimeSpan? ResizeTimeout + { + get + { + return this.omObject.ResizeTimeout; + } + set + { + this.omObject.ResizeTimeout = value; + } + } + + public PSSchedulingPolicy SchedulingPolicy + { + get + { + if (((this.schedulingPolicy == null) + && (this.omObject.SchedulingPolicy != null))) + { + this.schedulingPolicy = new PSSchedulingPolicy(this.omObject.SchedulingPolicy); + } + return this.schedulingPolicy; + } + set + { + if ((value == null)) + { + this.omObject.SchedulingPolicy = null; + } + else + { + this.omObject.SchedulingPolicy = value.omObject; + } + this.schedulingPolicy = value; + } + } + + public PSStartTask StartTask + { + get + { + if (((this.startTask == null) + && (this.omObject.StartTask != null))) + { + this.startTask = new PSStartTask(this.omObject.StartTask); + } + return this.startTask; + } + set + { + if ((value == null)) + { + this.omObject.StartTask = null; + } + else + { + this.omObject.StartTask = value.omObject; + } + this.startTask = value; + } + } + + public System.Int32? TargetDedicated + { + get + { + return this.omObject.TargetDedicated; + } + set + { + this.omObject.TargetDedicated = value; + } + } + + public string TargetOSVersion + { + get + { + return this.omObject.TargetOSVersion; + } + set + { + this.omObject.TargetOSVersion = value; + } + } + + public string VMSize + { + get + { + return this.omObject.VMSize; + } + set + { + this.omObject.VMSize = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSPoolStatistics.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSPoolStatistics.cs new file mode 100644 index 000000000000..9d6e8a11848f --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSPoolStatistics.cs @@ -0,0 +1,100 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSPoolStatistics + { + + internal Microsoft.Azure.Batch.PoolStatistics omObject; + + private PSUsageStatistics usageStatistics; + + private PSResourceStatistics resourceStatistics; + + internal PSPoolStatistics(Microsoft.Azure.Batch.PoolStatistics omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + + public System.DateTime? StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime? EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public PSUsageStatistics UsageStatistics + { + get + { + if (((this.usageStatistics == null) + && (this.omObject.UsageStatistics != null))) + { + this.usageStatistics = new PSUsageStatistics(this.omObject.UsageStatistics); + } + return this.usageStatistics; + } + } + + public PSResourceStatistics ResourceStatistics + { + get + { + if (((this.resourceStatistics == null) + && (this.omObject.ResourceStatistics != null))) + { + this.resourceStatistics = new PSResourceStatistics(this.omObject.ResourceStatistics); + } + return this.resourceStatistics; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSRecentJob.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSRecentJob.cs new file mode 100644 index 000000000000..15d3d15d090a --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSRecentJob.cs @@ -0,0 +1,62 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSRecentJob + { + + internal Microsoft.Azure.Batch.RecentJob omObject; + + internal PSRecentJob(Microsoft.Azure.Batch.RecentJob omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + + public string Name + { + get + { + return this.omObject.Name; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSResizeError.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSResizeError.cs new file mode 100644 index 000000000000..a78d92d747a7 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSResizeError.cs @@ -0,0 +1,87 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSResizeError + { + + internal Microsoft.Azure.Batch.ResizeError omObject; + + private IEnumerable values; + + internal PSResizeError(Microsoft.Azure.Batch.ResizeError omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Code + { + get + { + return this.omObject.Code; + } + } + + public string Message + { + get + { + return this.omObject.Message; + } + } + + public IEnumerable Values + { + get + { + if (((this.values == null) + && (this.omObject.Values != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.Values.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSNameValuePair(enumerator.Current)); + } + this.values = list; + } + return this.values; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSResourceFile.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSResourceFile.cs new file mode 100644 index 000000000000..cdc80c658d16 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSResourceFile.cs @@ -0,0 +1,67 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSResourceFile + { + + internal Microsoft.Azure.Batch.IResourceFile omObject; + + public PSResourceFile(string blobSource, string filePath) + { + this.omObject = new Microsoft.Azure.Batch.ResourceFile(blobSource, filePath); + } + + internal PSResourceFile(Microsoft.Azure.Batch.IResourceFile omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string BlobSource + { + get + { + return this.omObject.BlobSource; + } + } + + public string FilePath + { + get + { + return this.omObject.FilePath; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSResourceStatistics.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSResourceStatistics.cs new file mode 100644 index 000000000000..68eaae332101 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSResourceStatistics.cs @@ -0,0 +1,154 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSResourceStatistics + { + + internal Microsoft.Azure.Batch.ResourceStatistics omObject; + + internal PSResourceStatistics(Microsoft.Azure.Batch.ResourceStatistics omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime? StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime? EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public double AvgCPU + { + get + { + return this.omObject.AvgCPU; + } + } + + public double AvgMemory + { + get + { + return this.omObject.AvgMemory; + } + } + + public double PeakMemory + { + get + { + return this.omObject.PeakMemory; + } + } + + public long AvgDisk + { + get + { + return this.omObject.AvgDisk; + } + } + + public long PeakDisk + { + get + { + return this.omObject.PeakDisk; + } + } + + public long DiskReadIOps + { + get + { + return this.omObject.DiskReadIOps; + } + } + + public long DiskWriteIOps + { + get + { + return this.omObject.DiskWriteIOps; + } + set + { + this.omObject.DiskWriteIOps = value; + } + } + + public long DiskReadBytes + { + get + { + return this.omObject.DiskReadBytes; + } + } + + public long DiskWriteBytes + { + get + { + return this.omObject.DiskWriteBytes; + } + } + + public long NetworkReadBytes + { + get + { + return this.omObject.NetworkReadBytes; + } + } + + public long NetworkWriteBytes + { + get + { + return this.omObject.NetworkWriteBytes; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSSchedulingPolicy.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSSchedulingPolicy.cs new file mode 100644 index 000000000000..8ee6489621d8 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSSchedulingPolicy.cs @@ -0,0 +1,54 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSSchedulingPolicy + { + + internal Microsoft.Azure.Batch.SchedulingPolicy omObject; + + internal PSSchedulingPolicy(Microsoft.Azure.Batch.SchedulingPolicy omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public Microsoft.Azure.Batch.Common.TVMFillType? VMFillType + { + get + { + return this.omObject.VMFillType; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSStartTask.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSStartTask.cs new file mode 100644 index 000000000000..a163c5205f28 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSStartTask.cs @@ -0,0 +1,173 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSStartTask + { + + internal Microsoft.Azure.Batch.IStartTask omObject; + + private IList environmentSettings; + + private IList resourceFiles; + + public PSStartTask() + { + this.omObject = new Microsoft.Azure.Batch.StartTask(); + } + + internal PSStartTask(Microsoft.Azure.Batch.IStartTask omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string CommandLine + { + get + { + return this.omObject.CommandLine; + } + set + { + this.omObject.CommandLine = value; + } + } + + public IList EnvironmentSettings + { + get + { + if (((this.environmentSettings == null) + && (this.omObject.EnvironmentSettings != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.EnvironmentSettings.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSEnvironmentSetting(enumerator.Current)); + } + this.environmentSettings = list; + } + return this.environmentSettings; + } + set + { + if ((value == null)) + { + this.omObject.EnvironmentSettings = null; + } + else + { + this.omObject.EnvironmentSettings = new List(); + } + this.environmentSettings = value; + } + } + + public System.Int32? MaxTaskRetryCount + { + get + { + return this.omObject.MaxTaskRetryCount; + } + set + { + this.omObject.MaxTaskRetryCount = value; + } + } + + public IList ResourceFiles + { + get + { + if (((this.resourceFiles == null) + && (this.omObject.ResourceFiles != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.ResourceFiles.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSResourceFile(enumerator.Current)); + } + this.resourceFiles = list; + } + return this.resourceFiles; + } + set + { + if ((value == null)) + { + this.omObject.ResourceFiles = null; + } + else + { + this.omObject.ResourceFiles = new List(); + } + this.resourceFiles = value; + } + } + + public System.Boolean? RunElevated + { + get + { + return this.omObject.RunElevated; + } + set + { + this.omObject.RunElevated = value; + } + } + + public System.Boolean? WaitForSuccess + { + get + { + return this.omObject.WaitForSuccess; + } + set + { + this.omObject.WaitForSuccess = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSStartTaskInformation.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSStartTaskInformation.cs new file mode 100644 index 000000000000..62c6c5a01f77 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSStartTaskInformation.cs @@ -0,0 +1,109 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSStartTaskInformation + { + + internal Microsoft.Azure.Batch.StartTaskInformation omObject; + + private PSTaskSchedulingError schedulingError; + + internal PSStartTaskInformation(Microsoft.Azure.Batch.StartTaskInformation omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public Microsoft.Azure.Batch.Common.StartTaskState State + { + get + { + return this.omObject.State; + } + } + + public System.DateTime StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime? EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public System.Int32? ExitCode + { + get + { + return this.omObject.ExitCode; + } + } + + public PSTaskSchedulingError SchedulingError + { + get + { + if (((this.schedulingError == null) + && (this.omObject.SchedulingError != null))) + { + this.schedulingError = new PSTaskSchedulingError(this.omObject.SchedulingError); + } + return this.schedulingError; + } + } + + public int RetryCount + { + get + { + return this.omObject.RetryCount; + } + } + + public System.DateTime? LastRetryTime + { + get + { + return this.omObject.LastRetryTime; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskConstraints.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskConstraints.cs new file mode 100644 index 000000000000..0e45fb69f405 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskConstraints.cs @@ -0,0 +1,70 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSTaskConstraints + { + + internal Microsoft.Azure.Batch.TaskConstraints omObject; + + internal PSTaskConstraints(Microsoft.Azure.Batch.TaskConstraints omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.TimeSpan? MaxWallClockTime + { + get + { + return this.omObject.MaxWallClockTime; + } + } + + public System.TimeSpan? RetentionTime + { + get + { + return this.omObject.RetentionTime; + } + } + + public System.Int32? MaxTaskRetryCount + { + get + { + return this.omObject.MaxTaskRetryCount; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskExecutionInformation.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskExecutionInformation.cs new file mode 100644 index 000000000000..9a9e18cc9b3a --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskExecutionInformation.cs @@ -0,0 +1,117 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSTaskExecutionInformation + { + + internal Microsoft.Azure.Batch.TaskExecutionInformation omObject; + + private PSTaskSchedulingError schedulingError; + + internal PSTaskExecutionInformation(Microsoft.Azure.Batch.TaskExecutionInformation omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime? EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public System.Int32? ExitCode + { + get + { + return this.omObject.ExitCode; + } + } + + public PSTaskSchedulingError SchedulingError + { + get + { + if (((this.schedulingError == null) + && (this.omObject.SchedulingError != null))) + { + this.schedulingError = new PSTaskSchedulingError(this.omObject.SchedulingError); + } + return this.schedulingError; + } + } + + public int RetryCount + { + get + { + return this.omObject.RetryCount; + } + } + + public System.DateTime? LastRetryTime + { + get + { + return this.omObject.LastRetryTime; + } + } + + public int RequeueCount + { + get + { + return this.omObject.RequeueCount; + } + } + + public System.DateTime? LastRequeueTime + { + get + { + return this.omObject.LastRequeueTime; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskFile.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskFile.cs new file mode 100644 index 000000000000..d0b08882a220 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskFile.cs @@ -0,0 +1,85 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSTaskFile + { + + internal Microsoft.Azure.Batch.ITaskFile omObject; + + private PSFileProperties properties; + + internal PSTaskFile(Microsoft.Azure.Batch.ITaskFile omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.Boolean? IsDirectory + { + get + { + return this.omObject.IsDirectory; + } + } + + public string Name + { + get + { + return this.omObject.Name; + } + } + + public PSFileProperties Properties + { + get + { + if (((this.properties == null) + && (this.omObject.Properties != null))) + { + this.properties = new PSFileProperties(this.omObject.Properties); + } + return this.properties; + } + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskInformation.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskInformation.cs new file mode 100644 index 000000000000..e7bf48bcc332 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskInformation.cs @@ -0,0 +1,101 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSTaskInformation + { + + internal Microsoft.Azure.Batch.TaskInformation omObject; + + private PSTaskExecutionInformation executionInformation; + + internal PSTaskInformation(Microsoft.Azure.Batch.TaskInformation omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string TaskUrl + { + get + { + return this.omObject.TaskUrl; + } + } + + public string WorkItemName + { + get + { + return this.omObject.WorkItemName; + } + } + + public string JobName + { + get + { + return this.omObject.JobName; + } + } + + public string TaskName + { + get + { + return this.omObject.TaskName; + } + } + + public Microsoft.Azure.Batch.Common.TaskState TaskState + { + get + { + return this.omObject.TaskState; + } + } + + public PSTaskExecutionInformation ExecutionInformation + { + get + { + if (((this.executionInformation == null) + && (this.omObject.ExecutionInformation != null))) + { + this.executionInformation = new PSTaskExecutionInformation(this.omObject.ExecutionInformation); + } + return this.executionInformation; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskSchedulingError.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskSchedulingError.cs new file mode 100644 index 000000000000..1bf962e40ed2 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskSchedulingError.cs @@ -0,0 +1,95 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSTaskSchedulingError + { + + internal Microsoft.Azure.Batch.TaskSchedulingError omObject; + + private IEnumerable details; + + internal PSTaskSchedulingError(Microsoft.Azure.Batch.TaskSchedulingError omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public Microsoft.Azure.Batch.Common.SchedulingErrorCategory Category + { + get + { + return this.omObject.Category; + } + } + + public string Code + { + get + { + return this.omObject.Code; + } + } + + public string Message + { + get + { + return this.omObject.Message; + } + } + + public IEnumerable Details + { + get + { + if (((this.details == null) + && (this.omObject.Details != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.Details.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSNameValuePair(enumerator.Current)); + } + this.details = list; + } + return this.details; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskStatistics.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskStatistics.cs new file mode 100644 index 000000000000..4dac334858e3 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSTaskStatistics.cs @@ -0,0 +1,142 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSTaskStatistics + { + + internal Microsoft.Azure.Batch.TaskStatistics omObject; + + internal PSTaskStatistics(Microsoft.Azure.Batch.TaskStatistics omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + + public System.DateTime StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public System.TimeSpan UserCPUTime + { + get + { + return this.omObject.UserCPUTime; + } + } + + public System.TimeSpan KernelCPUTime + { + get + { + return this.omObject.KernelCPUTime; + } + } + + public System.TimeSpan WallClockTime + { + get + { + return this.omObject.WallClockTime; + } + } + + public long ReadIOps + { + get + { + return this.omObject.ReadIOps; + } + } + + public long WriteIOps + { + get + { + return this.omObject.WriteIOps; + } + } + + public long ReadIOBytes + { + get + { + return this.omObject.ReadIOBytes; + } + } + + public long WriteIOBytes + { + get + { + return this.omObject.WriteIOBytes; + } + } + + public long NumRetries + { + get + { + return this.omObject.NumRetries; + } + } + + public System.TimeSpan WaitTime + { + get + { + return this.omObject.WaitTime; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSUsageStatistics.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSUsageStatistics.cs new file mode 100644 index 000000000000..f6c4bf6dec3a --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSUsageStatistics.cs @@ -0,0 +1,70 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSUsageStatistics + { + + internal Microsoft.Azure.Batch.UsageStatistics omObject; + + internal PSUsageStatistics(Microsoft.Azure.Batch.UsageStatistics omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime? StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime? EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public System.TimeSpan DedicatedTVMTime + { + get + { + return this.omObject.DedicatedTVMTime; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSUser.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSUser.cs new file mode 100644 index 000000000000..8181078b986b --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSUser.cs @@ -0,0 +1,90 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSUser + { + + internal Microsoft.Azure.Batch.IUser omObject; + + internal PSUser(Microsoft.Azure.Batch.IUser omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Name + { + get + { + return this.omObject.Name; + } + set + { + this.omObject.Name = value; + } + } + + public System.Boolean? IsAdmin + { + get + { + return this.omObject.IsAdmin; + } + set + { + this.omObject.IsAdmin = value; + } + } + + public System.DateTime ExpiryTime + { + get + { + return this.omObject.ExpiryTime; + } + set + { + this.omObject.ExpiryTime = value; + } + } + + public string Password + { + set + { + this.omObject.Password = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSVM.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSVM.cs new file mode 100644 index 000000000000..f9111fae3a21 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSVM.cs @@ -0,0 +1,231 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSVM + { + + internal Microsoft.Azure.Batch.IVM omObject; + + private PSStartTaskInformation startTaskInformation; + + private IEnumerable recentTasks; + + private PSStartTask startTask; + + private IEnumerable certificateReferences; + + private IEnumerable vMErrors; + + internal PSVM(Microsoft.Azure.Batch.IVM omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Name + { + get + { + return this.omObject.Name; + } + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + + public Microsoft.Azure.Batch.Common.TVMState State + { + get + { + return this.omObject.State; + } + } + + public System.DateTime StateTransitionTime + { + get + { + return this.omObject.StateTransitionTime; + } + } + + public System.DateTime? LastBootTime + { + get + { + return this.omObject.LastBootTime; + } + } + + public System.DateTime VMAllocationTime + { + get + { + return this.omObject.VMAllocationTime; + } + } + + public string IPAddress + { + get + { + return this.omObject.IPAddress; + } + } + + public string AffinityId + { + get + { + return this.omObject.AffinityId; + } + } + + public string VMSize + { + get + { + return this.omObject.VMSize; + } + } + + public System.Int32? TotalTasksRun + { + get + { + return this.omObject.TotalTasksRun; + } + } + + public PSStartTaskInformation StartTaskInformation + { + get + { + if (((this.startTaskInformation == null) + && (this.omObject.StartTaskInformation != null))) + { + this.startTaskInformation = new PSStartTaskInformation(this.omObject.StartTaskInformation); + } + return this.startTaskInformation; + } + } + + public IEnumerable RecentTasks + { + get + { + if (((this.recentTasks == null) + && (this.omObject.RecentTasks != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.RecentTasks.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSTaskInformation(enumerator.Current)); + } + this.recentTasks = list; + } + return this.recentTasks; + } + } + + public PSStartTask StartTask + { + get + { + if (((this.startTask == null) + && (this.omObject.StartTask != null))) + { + this.startTask = new PSStartTask(this.omObject.StartTask); + } + return this.startTask; + } + } + + public IEnumerable CertificateReferences + { + get + { + if (((this.certificateReferences == null) + && (this.omObject.CertificateReferences != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.CertificateReferences.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSCertificateReference(enumerator.Current)); + } + this.certificateReferences = list; + } + return this.certificateReferences; + } + } + + public IEnumerable VMErrors + { + get + { + if (((this.vMErrors == null) + && (this.omObject.VMErrors != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.VMErrors.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSVMError(enumerator.Current)); + } + this.vMErrors = list; + } + return this.vMErrors; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSVMError.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSVMError.cs new file mode 100644 index 000000000000..76913111b931 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSVMError.cs @@ -0,0 +1,87 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSVMError + { + + internal Microsoft.Azure.Batch.VMError omObject; + + private IEnumerable errorDetails; + + internal PSVMError(Microsoft.Azure.Batch.VMError omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Code + { + get + { + return this.omObject.Code; + } + } + + public string Message + { + get + { + return this.omObject.Message; + } + } + + public IEnumerable ErrorDetails + { + get + { + if (((this.errorDetails == null) + && (this.omObject.ErrorDetails != null))) + { + List list; + list = new List(); + IEnumerator enumerator; + enumerator = this.omObject.ErrorDetails.GetEnumerator(); + for ( + ; enumerator.MoveNext(); + ) + { + list.Add(new PSNameValuePair(enumerator.Current)); + } + this.errorDetails = list; + } + return this.errorDetails; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSVMInformation.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSVMInformation.cs new file mode 100644 index 000000000000..7f673e89be59 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSVMInformation.cs @@ -0,0 +1,78 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSVMInformation + { + + internal Microsoft.Azure.Batch.VMInformation omObject; + + internal PSVMInformation(Microsoft.Azure.Batch.VMInformation omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string AffinityId + { + get + { + return this.omObject.AffinityId; + } + } + + public string PoolName + { + get + { + return this.omObject.PoolName; + } + } + + public string VMName + { + get + { + return this.omObject.VMName; + } + } + + public string VMUrl + { + get + { + return this.omObject.VMUrl; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemExecutionInformation.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemExecutionInformation.cs new file mode 100644 index 000000000000..f168f7412f2f --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemExecutionInformation.cs @@ -0,0 +1,77 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSWorkItemExecutionInformation + { + + internal Microsoft.Azure.Batch.IWorkItemExecutionInformation omObject; + + private PSRecentJob recentJob; + + internal PSWorkItemExecutionInformation(Microsoft.Azure.Batch.IWorkItemExecutionInformation omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime? NextRunTime + { + get + { + return this.omObject.NextRunTime; + } + } + + public PSRecentJob RecentJob + { + get + { + if (((this.recentJob == null) + && (this.omObject.RecentJob != null))) + { + this.recentJob = new PSRecentJob(this.omObject.RecentJob); + } + return this.recentJob; + } + } + + public System.DateTime? EndTime + { + get + { + return this.omObject.EndTime; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemSchedule.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemSchedule.cs new file mode 100644 index 000000000000..6cf3f44de6e8 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemSchedule.cs @@ -0,0 +1,99 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSWorkItemSchedule + { + + internal Microsoft.Azure.Batch.IWorkItemSchedule omObject; + + public PSWorkItemSchedule() + { + this.omObject = new Microsoft.Azure.Batch.WorkItemSchedule(); + } + + internal PSWorkItemSchedule(Microsoft.Azure.Batch.IWorkItemSchedule omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public System.DateTime? DoNotRunUntil + { + get + { + return this.omObject.DoNotRunUntil; + } + set + { + this.omObject.DoNotRunUntil = value; + } + } + + public System.DateTime? DoNotRunAfter + { + get + { + return this.omObject.DoNotRunAfter; + } + set + { + this.omObject.DoNotRunAfter = value; + } + } + + public System.TimeSpan? StartWindow + { + get + { + return this.omObject.StartWindow; + } + set + { + this.omObject.StartWindow = value; + } + } + + public System.TimeSpan? RecurrenceInterval + { + get + { + return this.omObject.RecurrenceInterval; + } + set + { + this.omObject.RecurrenceInterval = value; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemStatistics.cs b/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemStatistics.cs new file mode 100644 index 000000000000..1e0bf9a61dc3 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Models/PSWorkItemStatistics.cs @@ -0,0 +1,158 @@ +// ----------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ----------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.Commands.Batch.Models +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.Azure.Batch; + + + public class PSWorkItemStatistics + { + + internal Microsoft.Azure.Batch.IWorkItemStatistics omObject; + + internal PSWorkItemStatistics(Microsoft.Azure.Batch.IWorkItemStatistics omObject) + { + if ((omObject == null)) + { + throw new System.ArgumentNullException("omObject"); + } + this.omObject = omObject; + } + + public string Url + { + get + { + return this.omObject.Url; + } + } + + public System.DateTime StartTime + { + get + { + return this.omObject.StartTime; + } + } + + public System.DateTime EndTime + { + get + { + return this.omObject.EndTime; + } + } + + public System.TimeSpan UserCPUTime + { + get + { + return this.omObject.UserCPUTime; + } + } + + public System.TimeSpan KernelCPUTime + { + get + { + return this.omObject.KernelCPUTime; + } + } + + public System.TimeSpan WallClockTime + { + get + { + return this.omObject.WallClockTime; + } + } + + public long ReadIOps + { + get + { + return this.omObject.ReadIOps; + } + } + + public long WriteIOps + { + get + { + return this.omObject.WriteIOps; + } + } + + public long ReadIOBytes + { + get + { + return this.omObject.ReadIOBytes; + } + } + + public long WriteIOBytes + { + get + { + return this.omObject.WriteIOBytes; + } + } + + public long NumSucceededTasks + { + get + { + return this.omObject.NumSucceededTasks; + } + } + + public long NumFailedTasks + { + get + { + return this.omObject.NumFailedTasks; + } + } + + public long NumRetries + { + get + { + return this.omObject.NumRetries; + } + } + + public System.TimeSpan WaitTime + { + get + { + return this.omObject.WaitTime; + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/Properties/Resources.Designer.cs b/src/ResourceManager/Batch/Commands.Batch/Properties/Resources.Designer.cs index dae98c3cc5fa..a3646fc9f535 100644 --- a/src/ResourceManager/Batch/Commands.Batch/Properties/Resources.Designer.cs +++ b/src/ResourceManager/Batch/Commands.Batch/Properties/Resources.Designer.cs @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Executing cmdlet with Batch account {0} with its {1} key. To change which key to use, set the KeyInUse property on the BatchAccountContext.. + /// + internal static string AccountAndKeyInUse { + get { + return ResourceManager.GetString("AccountAndKeyInUse", resourceCulture); + } + } + /// /// Looks up a localized string similar to Begin {0} call to RP. /// @@ -105,6 +114,33 @@ internal static string GBAK_GettingKeys { } } + /// + /// Looks up a localized string similar to Getting WorkItem "{0}". + /// + internal static string GBWI_GetByName { + get { + return ResourceManager.GetString("GBWI_GetByName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting enumerator for WorkItems matching the specified OData filter. + /// + internal static string GBWI_GetByOData { + get { + return ResourceManager.GetString("GBWI_GetByOData", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting enumerator for all WorkItems associated with the Batch account. + /// + internal static string GBWI_NoFilter { + get { + return ResourceManager.GetString("GBWI_NoFilter", resourceCulture); + } + } + /// /// Looks up a localized string similar to The endpoint is not recognized as valid: {0}. /// @@ -141,6 +177,15 @@ internal static string InvalidTagFormatNotUniqueName { } } + /// + /// Looks up a localized string similar to The current KeyInUse on this BatchAccountContext is the {0} key, but this key is not populated on the BatchAccountContext object. Use the Get-AzureBatchAccountKeys cmdlet to get a BatchAccountContext object with its keys populated.. + /// + internal static string KeyNotPresent { + get { + return ResourceManager.GetString("KeyNotPresent", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot find resource group name in ID property: {0}. /// diff --git a/src/ResourceManager/Batch/Commands.Batch/Properties/Resources.resx b/src/ResourceManager/Batch/Commands.Batch/Properties/Resources.resx index 73fbc2ec451e..5df36d03c3f0 100644 --- a/src/ResourceManager/Batch/Commands.Batch/Properties/Resources.resx +++ b/src/ResourceManager/Batch/Commands.Batch/Properties/Resources.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Executing cmdlet with Batch account {0} with its {1} key. To change which key to use, set the KeyInUse property on the BatchAccountContext. + Begin {0} call to RP @@ -132,6 +135,15 @@ Getting accounts in resource group {0} + + Getting WorkItem "{0}" + + + Getting enumerator for WorkItems matching the specified OData filter + + + Getting enumerator for all WorkItems associated with the Batch account + The endpoint is not recognized as valid: {0} @@ -144,6 +156,9 @@ Invalid tag format. Ensure that each tag has a unique name. Example: @{Name = "tagName1"; Value = "tagValue1"}, @{Name = "tagName2"; Value = "tagValue2"} + + The current KeyInUse on this BatchAccountContext is the {0} key, but this key is not populated on the BatchAccountContext object. Use the Get-AzureBatchAccountKeys cmdlet to get a BatchAccountContext object with its keys populated. + Cannot find resource group name in ID property: {0} diff --git a/src/ResourceManager/Batch/Commands.Batch/Utils/Constants.cs b/src/ResourceManager/Batch/Commands.Batch/Utils/Constants.cs new file mode 100644 index 000000000000..e8214c1d4b61 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/Utils/Constants.cs @@ -0,0 +1,22 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Batch.Utils +{ + public class Constants + { + public const string NameParameterSet = "Name"; + public const string ODataFilterParameterSet = "ODataFilter"; + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/WorkItems/GetBatchWorkItemCommand.cs b/src/ResourceManager/Batch/Commands.Batch/WorkItems/GetBatchWorkItemCommand.cs new file mode 100644 index 000000000000..0d7e3b0cca15 --- /dev/null +++ b/src/ResourceManager/Batch/Commands.Batch/WorkItems/GetBatchWorkItemCommand.cs @@ -0,0 +1,84 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Batch; +using Microsoft.Azure.Commands.Batch.Models; +using Microsoft.Azure.Commands.Batch.Properties; +using System; +using System.Collections.Generic; +using System.Management.Automation; +using Constants = Microsoft.Azure.Commands.Batch.Utils.Constants; + +namespace Microsoft.Azure.Commands.Batch +{ + [Cmdlet(VerbsCommon.Get, "AzureBatchWorkItem", DefaultParameterSetName = Constants.NameParameterSet), + OutputType(typeof(PSCloudWorkItem), ParameterSetName = new string[] { Constants.NameParameterSet }), + OutputType(typeof(IEnumerableAsyncExtended), ParameterSetName = new string[] { Constants.ODataFilterParameterSet })] + public class GetBatchWorkItemCommand : BatchObjectModelCmdletBase + { + [Parameter(Position = 0, ParameterSetName = Constants.NameParameterSet, Mandatory = false, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The name of the WorkItem to query.")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter(Mandatory = false, ParameterSetName = Constants.ODataFilterParameterSet, HelpMessage = "OData filter to use when querying for WorkItems.")] + [ValidateNotNullOrEmpty] + public string Filter { get; set; } + + public override void ExecuteCmdlet() + { + if (!string.IsNullOrEmpty(Name)) + { + WriteVerboseWithTimestamp(Resources.GBWI_GetByName, Name); + PSCloudWorkItem workItem = GetWorkItem(Name, additionalBehaviors: AdditionalBehaviors); + WriteObject(workItem); + } + else + { + ODATADetailLevel odata = null; + if (!string.IsNullOrEmpty(Filter)) + { + WriteVerboseWithTimestamp(Resources.GBWI_GetByOData); + odata = new ODATADetailLevel(filterClause: Filter); + } + else + { + WriteVerboseWithTimestamp(Resources.GBWI_NoFilter); + } + PSAsyncEnumerable workItemEnumerator = ListWorkItems(odata, AdditionalBehaviors); + WriteObject(workItemEnumerator); + } + } + + private PSCloudWorkItem GetWorkItem(string workItemName, ODATADetailLevel detailLevel = null, + IEnumerable additionalBehaviors = null) + { + using (IWorkItemManager wiManager = BatchContext.BatchOMClient.OpenWorkItemManager()) + { + ICloudWorkItem workItem = wiManager.GetWorkItem(workItemName, detailLevel, additionalBehaviors); + return new PSCloudWorkItem(workItem); + } + } + + private PSAsyncEnumerable ListWorkItems(ODATADetailLevel detailLevel = null, + IEnumerable additionalBehaviors = null) + { + using (IWorkItemManager wiManager = BatchContext.BatchOMClient.OpenWorkItemManager()) + { + IEnumerableAsyncExtended workItemEnumerator = wiManager.ListWorkItems(detailLevel, additionalBehaviors); + Func mappingFunction = w => { return new PSCloudWorkItem(w); }; + return new PSAsyncEnumerable(workItemEnumerator, mappingFunction); + } + } + } +} diff --git a/src/ResourceManager/Batch/Commands.Batch/packages.config b/src/ResourceManager/Batch/Commands.Batch/packages.config index c29bfcff95e0..278e260b6517 100644 --- a/src/ResourceManager/Batch/Commands.Batch/packages.config +++ b/src/ResourceManager/Batch/Commands.Batch/packages.config @@ -1,5 +1,6 @@  + @@ -9,8 +10,13 @@ + + + + + \ No newline at end of file