本文整理汇总了C#中BatchAccountContext类的典型用法代码示例。如果您正苦于以下问题:C# BatchAccountContext类的具体用法?C# BatchAccountContext怎么用?C# BatchAccountContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BatchAccountContext类属于命名空间,在下文中一共展示了BatchAccountContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertBatchAccountContextsAreEqual
public static void AssertBatchAccountContextsAreEqual(BatchAccountContext context1, BatchAccountContext context2)
{
if (context1 == null)
{
Assert.Null(context2);
return;
}
if (context2 == null)
{
Assert.Null(context1);
return;
}
Assert.Equal<string>(context1.AccountEndpoint, context2.AccountEndpoint);
Assert.Equal<string>(context1.AccountName, context2.AccountName);
Assert.Equal<string>(context1.Id, context2.Id);
Assert.Equal<string>(context1.Location, context2.Location);
Assert.Equal<string>(context1.PrimaryAccountKey, context2.PrimaryAccountKey);
Assert.Equal<string>(context1.ResourceGroupName, context2.ResourceGroupName);
Assert.Equal<string>(context1.SecondaryAccountKey, context2.SecondaryAccountKey);
Assert.Equal<string>(context1.State, context2.State);
Assert.Equal<string>(context1.Subscription, context2.Subscription);
Assert.Equal<string>(context1.TagsTable, context2.TagsTable);
Assert.Equal<string>(context1.TaskTenantUrl, context2.TaskTenantUrl);
}
示例2: NodeFileOperationParameters
public NodeFileOperationParameters(BatchAccountContext context, string jobId, string taskId, string poolId, string computeNodeId, string nodeFileName,
PSNodeFile nodeFile, IEnumerable<BatchClientBehavior> additionalBehaviors = null) : base(context, additionalBehaviors)
{
PSNodeFileType? nodeFileType = null;
if (nodeFile != null)
{
nodeFileType = PSNodeFileType.PSNodeFileInstance;
}
else if (!string.IsNullOrWhiteSpace(nodeFileName))
{
if (!string.IsNullOrWhiteSpace(jobId) && !string.IsNullOrWhiteSpace(taskId))
{
nodeFileType = PSNodeFileType.Task;
}
else if (!string.IsNullOrWhiteSpace(poolId) && !string.IsNullOrWhiteSpace(computeNodeId))
{
nodeFileType = PSNodeFileType.ComputeNode;
}
}
if (nodeFileType == null)
{
throw new ArgumentException(Resources.NoNodeFile);
}
this.NodeFileType = nodeFileType.Value;
this.JobId = jobId;
this.TaskId = taskId;
this.PoolId = poolId;
this.ComputeNodeId = computeNodeId;
this.NodeFileName = nodeFileName;
this.NodeFile = nodeFile;
}
示例3: GetAllPoolsLifetimeStatistics
/// <summary>
/// Gets all pools lifetime summary statistics
/// </summary>
/// <param name="context">The account to use.</param>
/// <param name="additionBehaviors">Additional client behaviors to perform.</param>
public PSPoolStatistics GetAllPoolsLifetimeStatistics(BatchAccountContext context, IEnumerable<BatchClientBehavior> additionBehaviors = null)
{
PoolOperations poolOperations = context.BatchOMClient.PoolOperations;
WriteVerbose(string.Format(Resources.GetAllPoolsLifetimeStatistics));
PoolStatistics poolStatistics = poolOperations.GetAllPoolsLifetimeStatistics(additionBehaviors);
PSPoolStatistics psPoolStatistics = new PSPoolStatistics(poolStatistics);
return psPoolStatistics;
}
示例4: NewJobScheduleParameters
public NewJobScheduleParameters(BatchAccountContext context, string jobScheduleId, IEnumerable<BatchClientBehavior> additionalBehaviors = null)
: base(context, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(jobScheduleId))
{
throw new ArgumentNullException("jobScheduleId");
}
this.JobScheduleId = jobScheduleId;
}
示例5: NewPoolParameters
public NewPoolParameters(BatchAccountContext context, string poolId, IEnumerable<BatchClientBehavior> additionalBehaviors = null)
: base(context, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(poolId))
{
throw new ArgumentNullException("poolId");
}
this.PoolId = poolId;
}
示例6: BatchClientParametersBase
protected BatchClientParametersBase(BatchAccountContext context, IEnumerable<BatchClientBehavior> additionalBehaviors = null)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
this.Context = context;
this.AdditionalBehaviors = additionalBehaviors;
}
示例7: ChangeOSVersionParameters
public ChangeOSVersionParameters(BatchAccountContext context, string poolId, PSCloudPool pool, string targetOSVersion,
IEnumerable<BatchClientBehavior> additionalBehaviors = null) : base(context, poolId, pool, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(targetOSVersion))
{
throw new ArgumentNullException("targetOSVersion");
}
this.TargetOSVersion = targetOSVersion;
}
示例8: NewTaskParameters
public NewTaskParameters(BatchAccountContext context, string jobId, PSCloudJob job, string taskId, IEnumerable<BatchClientBehavior> additionalBehaviors = null)
: base(context, jobId, job, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(taskId))
{
throw new ArgumentNullException("taskId");
}
this.TaskId = taskId;
}
示例9: AutoScaleParameters
public AutoScaleParameters(BatchAccountContext context, string poolId, PSCloudPool pool, string autoScaleFormula,
IEnumerable<BatchClientBehavior> additionalBehaviors = null) : base(context, poolId, pool, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(autoScaleFormula))
{
throw new ArgumentNullException("autoScaleFormula");
}
this.AutoScaleFormula = autoScaleFormula;
}
示例10: NewWorkItemParameters
public NewWorkItemParameters(BatchAccountContext context, string workItemName, IEnumerable<BatchClientBehavior> additionalBehaviors = null)
: base(context, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(workItemName))
{
throw new ArgumentNullException("poolName");
}
this.WorkItemName = workItemName;
}
示例11: NewBulkTaskParameters
public NewBulkTaskParameters(BatchAccountContext context, string jobId, PSCloudJob job, PSCloudTask[] tasks, IEnumerable<BatchClientBehavior> additionalBehaviors = null)
: base(context, jobId, job, additionalBehaviors)
{
if (tasks == null)
{
throw new ArgumentNullException("taskCollection");
}
this.Tasks = tasks;
}
示例12: JobOperationParameters
public JobOperationParameters(BatchAccountContext context, string jobId, PSCloudJob job,
IEnumerable<BatchClientBehavior> additionalBehaviors = null) : base(context, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(jobId) && job == null)
{
throw new ArgumentNullException(Resources.NoJob);
}
this.JobId = jobId;
this.Job = job;
}
示例13: DownloadRemoteDesktopProtocolFileOptions
public DownloadRemoteDesktopProtocolFileOptions(BatchAccountContext context, string poolId, string computeNodeId, PSComputeNode computeNode, string destinationPath,
Stream stream, IEnumerable<BatchClientBehavior> additionalBehaviors = null) : base(context, poolId, computeNodeId, computeNode, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(destinationPath) && stream == null)
{
throw new ArgumentNullException(Resources.NoDownloadDestination);
}
this.DestinationPath = destinationPath;
this.Stream = stream;
}
示例14: PoolOperationParameters
public PoolOperationParameters(BatchAccountContext context, string poolName, PSCloudPool pool,
IEnumerable<BatchClientBehavior> additionalBehaviors = null) : base(context, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(poolName) && pool == null)
{
throw new ArgumentNullException(Resources.NoPool);
}
this.PoolName = poolName;
this.Pool = pool;
}
示例15: NewCertificateParameters
public NewCertificateParameters(BatchAccountContext context, string filePath, byte[] rawData,
IEnumerable<BatchClientBehavior> additionalBehaviors = null) : base(context, additionalBehaviors)
{
if (string.IsNullOrWhiteSpace(filePath) && rawData == null)
{
throw new ArgumentException(Resources.NoCertificateData);
}
this.FilePath = filePath;
this.RawData = rawData;
}