diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/AutoUserSpecification.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/AutoUserSpecification.cs
index 655ea827b2ca..ecd162d250ab 100644
--- a/sdk/batch/Azure.Compute.Batch/src/Generated/AutoUserSpecification.cs
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/AutoUserSpecification.cs
@@ -51,7 +51,7 @@ public AutoUserSpecification()
}
/// Initializes a new instance of .
- /// The scope for the auto user. The default value is pool. If the pool is running Windows, a value of Task should be specified if stricter isolation between tasks is required, such as if the task mutates the registry in a way which could impact other tasks.
+ /// The scope for the auto user. The default value is pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by StartTasks.
/// The elevation level of the auto user. The default value is nonAdmin.
/// Keeps track of any properties unknown to the library.
internal AutoUserSpecification(AutoUserScope? scope, ElevationLevel? elevationLevel, IDictionary serializedAdditionalRawData)
@@ -61,7 +61,7 @@ internal AutoUserSpecification(AutoUserScope? scope, ElevationLevel? elevationLe
_serializedAdditionalRawData = serializedAdditionalRawData;
}
- /// The scope for the auto user. The default value is pool. If the pool is running Windows, a value of Task should be specified if stricter isolation between tasks is required, such as if the task mutates the registry in a way which could impact other tasks.
+ /// The scope for the auto user. The default value is pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by StartTasks.
public AutoUserScope? Scope { get; set; }
/// The elevation level of the auto user. The default value is nonAdmin.
public ElevationLevel? ElevationLevel { get; set; }
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/AutomaticOsUpgradePolicy.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/AutomaticOsUpgradePolicy.cs
index a55f474ba013..c3b9be08a2f0 100644
--- a/sdk/batch/Azure.Compute.Batch/src/Generated/AutomaticOsUpgradePolicy.cs
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/AutomaticOsUpgradePolicy.cs
@@ -52,7 +52,7 @@ public AutomaticOsUpgradePolicy()
/// Initializes a new instance of .
/// Whether OS image rollback feature should be disabled.
- /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration) cannot be set to true.
+ /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration) cannot be set to true.
/// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS.
/// Defer OS upgrades on the TVMs if they are running tasks.
/// Keeps track of any properties unknown to the library.
@@ -67,7 +67,7 @@ internal AutomaticOsUpgradePolicy(bool? disableAutomaticRollback, bool? enableAu
/// Whether OS image rollback feature should be disabled.
public bool? DisableAutomaticRollback { get; set; }
- /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration) cannot be set to true.
+ /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration) cannot be set to true.
public bool? EnableAutomaticOsUpgrade { get; set; }
/// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS.
public bool? UseRollingUpgradePolicy { get; set; }
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificate.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificate.Serialization.cs
new file mode 100644
index 000000000000..123ea0c12d5d
--- /dev/null
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificate.Serialization.cs
@@ -0,0 +1,294 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Compute.Batch
+{
+ public partial class BatchCertificate : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BatchCertificate)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("thumbprint"u8);
+ writer.WriteStringValue(Thumbprint);
+ writer.WritePropertyName("thumbprintAlgorithm"u8);
+ writer.WriteStringValue(ThumbprintAlgorithm);
+ if (options.Format != "W" && Optional.IsDefined(Url))
+ {
+ writer.WritePropertyName("url"u8);
+ writer.WriteStringValue(Url);
+ }
+ if (options.Format != "W" && Optional.IsDefined(State))
+ {
+ writer.WritePropertyName("state"u8);
+ writer.WriteStringValue(State.Value.ToString());
+ }
+ if (options.Format != "W" && Optional.IsDefined(StateTransitionTime))
+ {
+ writer.WritePropertyName("stateTransitionTime"u8);
+ writer.WriteStringValue(StateTransitionTime.Value, "O");
+ }
+ if (options.Format != "W" && Optional.IsDefined(PreviousState))
+ {
+ writer.WritePropertyName("previousState"u8);
+ writer.WriteStringValue(PreviousState.Value.ToString());
+ }
+ if (options.Format != "W" && Optional.IsDefined(PreviousStateTransitionTime))
+ {
+ writer.WritePropertyName("previousStateTransitionTime"u8);
+ writer.WriteStringValue(PreviousStateTransitionTime.Value, "O");
+ }
+ if (options.Format != "W" && Optional.IsDefined(PublicData))
+ {
+ writer.WritePropertyName("publicData"u8);
+ writer.WriteStringValue(PublicData);
+ }
+ if (options.Format != "W" && Optional.IsDefined(DeleteCertificateError))
+ {
+ writer.WritePropertyName("deleteCertificateError"u8);
+ writer.WriteObjectValue(DeleteCertificateError, options);
+ }
+ writer.WritePropertyName("data"u8);
+ writer.WriteStringValue(Data);
+ if (Optional.IsDefined(CertificateFormat))
+ {
+ writer.WritePropertyName("certificateFormat"u8);
+ writer.WriteStringValue(CertificateFormat.Value.ToString());
+ }
+ if (Optional.IsDefined(Password))
+ {
+ writer.WritePropertyName("password"u8);
+ writer.WriteStringValue(Password);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ BatchCertificate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BatchCertificate)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeBatchCertificate(document.RootElement, options);
+ }
+
+ internal static BatchCertificate DeserializeBatchCertificate(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string thumbprint = default;
+ string thumbprintAlgorithm = default;
+ string url = default;
+ BatchCertificateState? state = default;
+ DateTimeOffset? stateTransitionTime = default;
+ BatchCertificateState? previousState = default;
+ DateTimeOffset? previousStateTransitionTime = default;
+ string publicData = default;
+ DeleteBatchCertificateError deleteCertificateError = default;
+ string data = default;
+ BatchCertificateFormat? certificateFormat = default;
+ string password = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("thumbprint"u8))
+ {
+ thumbprint = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("thumbprintAlgorithm"u8))
+ {
+ thumbprintAlgorithm = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("url"u8))
+ {
+ url = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("state"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ state = new BatchCertificateState(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("stateTransitionTime"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ stateTransitionTime = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("previousState"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ previousState = new BatchCertificateState(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("previousStateTransitionTime"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ previousStateTransitionTime = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("publicData"u8))
+ {
+ publicData = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("deleteCertificateError"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ deleteCertificateError = DeleteBatchCertificateError.DeserializeDeleteBatchCertificateError(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("data"u8))
+ {
+ data = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("certificateFormat"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ certificateFormat = new BatchCertificateFormat(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("password"u8))
+ {
+ password = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new BatchCertificate(
+ thumbprint,
+ thumbprintAlgorithm,
+ url,
+ state,
+ stateTransitionTime,
+ previousState,
+ previousStateTransitionTime,
+ publicData,
+ deleteCertificateError,
+ data,
+ certificateFormat,
+ password,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(BatchCertificate)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ BatchCertificate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeBatchCertificate(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(BatchCertificate)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static BatchCertificate FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeBatchCertificate(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificate.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificate.cs
new file mode 100644
index 000000000000..6e858116505e
--- /dev/null
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificate.cs
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Compute.Batch
+{
+ ///
+ /// A Certificate that can be installed on Compute Nodes and can be used to
+ /// authenticate operations on the machine.
+ ///
+ public partial class BatchCertificate
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed).
+ /// The algorithm used to derive the thumbprint. This must be sha1.
+ /// The base64-encoded contents of the Certificate. The maximum size is 10KB.
+ /// , or is null.
+ public BatchCertificate(string thumbprint, string thumbprintAlgorithm, string data)
+ {
+ Argument.AssertNotNull(thumbprint, nameof(thumbprint));
+ Argument.AssertNotNull(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNull(data, nameof(data));
+
+ Thumbprint = thumbprint;
+ ThumbprintAlgorithm = thumbprintAlgorithm;
+ Data = data;
+ }
+
+ /// Initializes a new instance of .
+ /// The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed).
+ /// The algorithm used to derive the thumbprint. This must be sha1.
+ /// The URL of the Certificate.
+ /// The state of the Certificate.
+ /// The time at which the Certificate entered its current state.
+ /// The previous state of the Certificate. This property is not set if the Certificate is in its initial active state.
+ /// The time at which the Certificate entered its previous state. This property is not set if the Certificate is in its initial Active state.
+ /// The public part of the Certificate as a base-64 encoded .cer file.
+ /// The error that occurred on the last attempt to delete this Certificate. This property is set only if the Certificate is in the DeleteFailed state.
+ /// The base64-encoded contents of the Certificate. The maximum size is 10KB.
+ /// The format of the Certificate data.
+ /// The password to access the Certificate's private key. This must be omitted if the Certificate format is cer.
+ /// Keeps track of any properties unknown to the library.
+ internal BatchCertificate(string thumbprint, string thumbprintAlgorithm, string url, BatchCertificateState? state, DateTimeOffset? stateTransitionTime, BatchCertificateState? previousState, DateTimeOffset? previousStateTransitionTime, string publicData, DeleteBatchCertificateError deleteCertificateError, string data, BatchCertificateFormat? certificateFormat, string password, IDictionary serializedAdditionalRawData)
+ {
+ Thumbprint = thumbprint;
+ ThumbprintAlgorithm = thumbprintAlgorithm;
+ Url = url;
+ State = state;
+ StateTransitionTime = stateTransitionTime;
+ PreviousState = previousState;
+ PreviousStateTransitionTime = previousStateTransitionTime;
+ PublicData = publicData;
+ DeleteCertificateError = deleteCertificateError;
+ Data = data;
+ CertificateFormat = certificateFormat;
+ Password = password;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal BatchCertificate()
+ {
+ }
+
+ /// The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed).
+ public string Thumbprint { get; set; }
+ /// The algorithm used to derive the thumbprint. This must be sha1.
+ public string ThumbprintAlgorithm { get; set; }
+ /// The URL of the Certificate.
+ public string Url { get; }
+ /// The state of the Certificate.
+ public BatchCertificateState? State { get; }
+ /// The time at which the Certificate entered its current state.
+ public DateTimeOffset? StateTransitionTime { get; }
+ /// The previous state of the Certificate. This property is not set if the Certificate is in its initial active state.
+ public BatchCertificateState? PreviousState { get; }
+ /// The time at which the Certificate entered its previous state. This property is not set if the Certificate is in its initial Active state.
+ public DateTimeOffset? PreviousStateTransitionTime { get; }
+ /// The public part of the Certificate as a base-64 encoded .cer file.
+ public string PublicData { get; }
+ /// The error that occurred on the last attempt to delete this Certificate. This property is set only if the Certificate is in the DeleteFailed state.
+ public DeleteBatchCertificateError DeleteCertificateError { get; }
+ /// The base64-encoded contents of the Certificate. The maximum size is 10KB.
+ public string Data { get; set; }
+ /// The format of the Certificate data.
+ public BatchCertificateFormat? CertificateFormat { get; set; }
+ /// The password to access the Certificate's private key. This must be omitted if the Certificate format is cer.
+ public string Password { get; set; }
+ }
+}
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateFormat.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateFormat.cs
new file mode 100644
index 000000000000..121b2cffc624
--- /dev/null
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateFormat.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Compute.Batch
+{
+ /// BatchCertificateFormat enums.
+ public readonly partial struct BatchCertificateFormat : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public BatchCertificateFormat(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string PfxValue = "pfx";
+ private const string CerValue = "cer";
+
+ /// The Certificate is a PFX (PKCS#12) formatted Certificate or Certificate chain.
+ public static BatchCertificateFormat Pfx { get; } = new BatchCertificateFormat(PfxValue);
+ /// The Certificate is a base64-encoded X.509 Certificate.
+ public static BatchCertificateFormat Cer { get; } = new BatchCertificateFormat(CerValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(BatchCertificateFormat left, BatchCertificateFormat right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(BatchCertificateFormat left, BatchCertificateFormat right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator BatchCertificateFormat(string value) => new BatchCertificateFormat(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is BatchCertificateFormat other && Equals(other);
+ ///
+ public bool Equals(BatchCertificateFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateReference.Serialization.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateReference.Serialization.cs
new file mode 100644
index 000000000000..265e7a1d65fd
--- /dev/null
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateReference.Serialization.cs
@@ -0,0 +1,207 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.Compute.Batch
+{
+ public partial class BatchCertificateReference : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BatchCertificateReference)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("thumbprint"u8);
+ writer.WriteStringValue(Thumbprint);
+ writer.WritePropertyName("thumbprintAlgorithm"u8);
+ writer.WriteStringValue(ThumbprintAlgorithm);
+ if (Optional.IsDefined(StoreLocation))
+ {
+ writer.WritePropertyName("storeLocation"u8);
+ writer.WriteStringValue(StoreLocation.Value.ToString());
+ }
+ if (Optional.IsDefined(StoreName))
+ {
+ writer.WritePropertyName("storeName"u8);
+ writer.WriteStringValue(StoreName);
+ }
+ if (Optional.IsCollectionDefined(Visibility))
+ {
+ writer.WritePropertyName("visibility"u8);
+ writer.WriteStartArray();
+ foreach (var item in Visibility)
+ {
+ writer.WriteStringValue(item.ToString());
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ BatchCertificateReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BatchCertificateReference)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeBatchCertificateReference(document.RootElement, options);
+ }
+
+ internal static BatchCertificateReference DeserializeBatchCertificateReference(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string thumbprint = default;
+ string thumbprintAlgorithm = default;
+ BatchCertificateStoreLocation? storeLocation = default;
+ string storeName = default;
+ IList visibility = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("thumbprint"u8))
+ {
+ thumbprint = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("thumbprintAlgorithm"u8))
+ {
+ thumbprintAlgorithm = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("storeLocation"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ storeLocation = new BatchCertificateStoreLocation(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("storeName"u8))
+ {
+ storeName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("visibility"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(new BatchCertificateVisibility(item.GetString()));
+ }
+ visibility = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new BatchCertificateReference(
+ thumbprint,
+ thumbprintAlgorithm,
+ storeLocation,
+ storeName,
+ visibility ?? new ChangeTrackingList(),
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(BatchCertificateReference)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ BatchCertificateReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeBatchCertificateReference(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(BatchCertificateReference)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static BatchCertificateReference FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeBatchCertificateReference(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateReference.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateReference.cs
new file mode 100644
index 000000000000..5255ea9eff66
--- /dev/null
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateReference.cs
@@ -0,0 +1,95 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.Compute.Batch
+{
+ /// A reference to a Certificate to be installed on Compute Nodes in a Pool. Warning: This object is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
+ public partial class BatchCertificateReference
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// The thumbprint of the Certificate.
+ /// The algorithm with which the thumbprint is associated. This must be sha1.
+ /// or is null.
+ public BatchCertificateReference(string thumbprint, string thumbprintAlgorithm)
+ {
+ Argument.AssertNotNull(thumbprint, nameof(thumbprint));
+ Argument.AssertNotNull(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+
+ Thumbprint = thumbprint;
+ ThumbprintAlgorithm = thumbprintAlgorithm;
+ Visibility = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// The thumbprint of the Certificate.
+ /// The algorithm with which the thumbprint is associated. This must be sha1.
+ /// The location of the Certificate store on the Compute Node into which to install the Certificate. The default value is currentuser. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory.
+ /// The name of the Certificate store on the Compute Node into which to install the Certificate. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My.
+ /// Which user Accounts on the Compute Node should have access to the private data of the Certificate. You can specify more than one visibility in this collection. The default is all Accounts.
+ /// Keeps track of any properties unknown to the library.
+ internal BatchCertificateReference(string thumbprint, string thumbprintAlgorithm, BatchCertificateStoreLocation? storeLocation, string storeName, IList visibility, IDictionary serializedAdditionalRawData)
+ {
+ Thumbprint = thumbprint;
+ ThumbprintAlgorithm = thumbprintAlgorithm;
+ StoreLocation = storeLocation;
+ StoreName = storeName;
+ Visibility = visibility;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal BatchCertificateReference()
+ {
+ }
+
+ /// The thumbprint of the Certificate.
+ public string Thumbprint { get; set; }
+ /// The algorithm with which the thumbprint is associated. This must be sha1.
+ public string ThumbprintAlgorithm { get; set; }
+ /// The location of the Certificate store on the Compute Node into which to install the Certificate. The default value is currentuser. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory.
+ public BatchCertificateStoreLocation? StoreLocation { get; set; }
+ /// The name of the Certificate store on the Compute Node into which to install the Certificate. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My.
+ public string StoreName { get; set; }
+ /// Which user Accounts on the Compute Node should have access to the private data of the Certificate. You can specify more than one visibility in this collection. The default is all Accounts.
+ public IList Visibility { get; }
+ }
+}
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateState.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateState.cs
new file mode 100644
index 000000000000..59674caeb91c
--- /dev/null
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateState.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Compute.Batch
+{
+ /// BatchCertificateState enums.
+ public readonly partial struct BatchCertificateState : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public BatchCertificateState(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string ActiveValue = "active";
+ private const string DeletingValue = "deleting";
+ private const string DeleteFailedValue = "deletefailed";
+
+ /// The Certificate is available for use in Pools.
+ public static BatchCertificateState Active { get; } = new BatchCertificateState(ActiveValue);
+ /// The user has requested that the Certificate be deleted, but the delete operation has not yet completed. You may not reference the Certificate when creating or updating Pools.
+ public static BatchCertificateState Deleting { get; } = new BatchCertificateState(DeletingValue);
+ /// The user requested that the Certificate be deleted, but there are Pools that still have references to the Certificate, or it is still installed on one or more Nodes. (The latter can occur if the Certificate has been removed from the Pool, but the Compute Node has not yet restarted. Compute Nodes refresh their Certificates only when they restart.) You may use the cancel Certificate delete operation to cancel the delete, or the delete Certificate operation to retry the delete.
+ public static BatchCertificateState DeleteFailed { get; } = new BatchCertificateState(DeleteFailedValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(BatchCertificateState left, BatchCertificateState right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(BatchCertificateState left, BatchCertificateState right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator BatchCertificateState(string value) => new BatchCertificateState(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is BatchCertificateState other && Equals(other);
+ ///
+ public bool Equals(BatchCertificateState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateStoreLocation.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateStoreLocation.cs
new file mode 100644
index 000000000000..191a6833d3f3
--- /dev/null
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateStoreLocation.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Compute.Batch
+{
+ /// BatchCertificateStoreLocation enums.
+ public readonly partial struct BatchCertificateStoreLocation : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public BatchCertificateStoreLocation(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string CurrentUserValue = "currentuser";
+ private const string LocalMachineValue = "localmachine";
+
+ /// Certificates should be installed to the CurrentUser Certificate store.
+ public static BatchCertificateStoreLocation CurrentUser { get; } = new BatchCertificateStoreLocation(CurrentUserValue);
+ /// Certificates should be installed to the LocalMachine Certificate store.
+ public static BatchCertificateStoreLocation LocalMachine { get; } = new BatchCertificateStoreLocation(LocalMachineValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(BatchCertificateStoreLocation left, BatchCertificateStoreLocation right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(BatchCertificateStoreLocation left, BatchCertificateStoreLocation right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator BatchCertificateStoreLocation(string value) => new BatchCertificateStoreLocation(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is BatchCertificateStoreLocation other && Equals(other);
+ ///
+ public bool Equals(BatchCertificateStoreLocation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateVisibility.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateVisibility.cs
new file mode 100644
index 000000000000..ecd194378a4a
--- /dev/null
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchCertificateVisibility.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.Compute.Batch
+{
+ /// BatchCertificateVisibility enums.
+ public readonly partial struct BatchCertificateVisibility : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public BatchCertificateVisibility(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string StartTaskValue = "starttask";
+ private const string TaskValue = "task";
+ private const string RemoteUserValue = "remoteuser";
+
+ /// The Certificate should be visible to the user account under which the StartTask is run. Note that if AutoUser Scope is Pool for both the StartTask and a Task, this certificate will be visible to the Task as well.
+ public static BatchCertificateVisibility StartTask { get; } = new BatchCertificateVisibility(StartTaskValue);
+ /// The Certificate should be visible to the user accounts under which Job Tasks are run.
+ public static BatchCertificateVisibility Task { get; } = new BatchCertificateVisibility(TaskValue);
+ /// The Certificate should be visible to the user accounts under which users remotely access the Compute Node.
+ public static BatchCertificateVisibility RemoteUser { get; } = new BatchCertificateVisibility(RemoteUserValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(BatchCertificateVisibility left, BatchCertificateVisibility right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(BatchCertificateVisibility left, BatchCertificateVisibility right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator BatchCertificateVisibility(string value) => new BatchCertificateVisibility(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is BatchCertificateVisibility other && Equals(other);
+ ///
+ public bool Equals(BatchCertificateVisibility other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClient.cs b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClient.cs
index 47672eb0c12f..2021789f8bd3 100644
--- a/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClient.cs
+++ b/sdk/batch/Azure.Compute.Batch/src/Generated/BatchClient.cs
@@ -1656,14 +1656,15 @@ public virtual Response RemoveNodes(string poolId, RequestContent content, int?
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will delete the Job even if the corresponding nodes have not fully processed the deletion. The default value is false.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task DeleteJobAsync(string jobId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task DeleteJobAsync(string jobId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
@@ -1671,7 +1672,7 @@ public virtual async Task DeleteJobAsync(string jobId, int? timeOutInS
scope.Start();
try
{
- using HttpMessage message = CreateDeleteJobRequest(jobId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateDeleteJobRequest(jobId, timeOutInSeconds, ocpdate, force, requestConditions, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -1699,14 +1700,15 @@ public virtual async Task DeleteJobAsync(string jobId, int? timeOutInS
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will delete the Job even if the corresponding nodes have not fully processed the deletion. The default value is false.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response DeleteJob(string jobId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response DeleteJob(string jobId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
@@ -1714,7 +1716,7 @@ public virtual Response DeleteJob(string jobId, int? timeOutInSeconds = null, Da
scope.Start();
try
{
- using HttpMessage message = CreateDeleteJobRequest(jobId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateDeleteJobRequest(jobId, timeOutInSeconds, ocpdate, force, requestConditions, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -2379,6 +2381,7 @@ public virtual Response EnableJob(string jobId, int? timeOutInSeconds = null, Da
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will terminate the Job even if the corresponding nodes have not fully processed the termination. The default value is false.
/// The content to send as the request conditions of the request.
/// The cancellation token to use.
/// is null.
@@ -2391,14 +2394,14 @@ public virtual Response EnableJob(string jobId, int? timeOutInSeconds = null, Da
/// state, they will remain in the active state. Once a Job is terminated, new
/// Tasks cannot be added and any remaining active Tasks will not be scheduled.
///
- ///
- public virtual async Task TerminateJobAsync(string jobId, BatchJobTerminateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ ///
+ public virtual async Task TerminateJobAsync(string jobId, BatchJobTerminateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
using RequestContent content = parameters?.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await TerminateJobAsync(jobId, content, timeOutInSeconds, ocpdate, requestConditions, context).ConfigureAwait(false);
+ Response response = await TerminateJobAsync(jobId, content, timeOutInSeconds, ocpdate, force, requestConditions, context).ConfigureAwait(false);
return response;
}
@@ -2411,6 +2414,7 @@ public virtual async Task TerminateJobAsync(string jobId, BatchJobTerm
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will terminate the Job even if the corresponding nodes have not fully processed the termination. The default value is false.
/// The content to send as the request conditions of the request.
/// The cancellation token to use.
/// is null.
@@ -2423,14 +2427,14 @@ public virtual async Task TerminateJobAsync(string jobId, BatchJobTerm
/// state, they will remain in the active state. Once a Job is terminated, new
/// Tasks cannot be added and any remaining active Tasks will not be scheduled.
///
- ///
- public virtual Response TerminateJob(string jobId, BatchJobTerminateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ ///
+ public virtual Response TerminateJob(string jobId, BatchJobTerminateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
using RequestContent content = parameters?.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = TerminateJob(jobId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ Response response = TerminateJob(jobId, content, timeOutInSeconds, ocpdate, force, requestConditions, context);
return response;
}
@@ -2444,7 +2448,7 @@ public virtual Response TerminateJob(string jobId, BatchJobTerminateContent para
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
@@ -2457,14 +2461,15 @@ public virtual Response TerminateJob(string jobId, BatchJobTerminateContent para
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will terminate the Job even if the corresponding nodes have not fully processed the termination. The default value is false.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task TerminateJobAsync(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task TerminateJobAsync(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
@@ -2472,7 +2477,7 @@ public virtual async Task TerminateJobAsync(string jobId, RequestConte
scope.Start();
try
{
- using HttpMessage message = CreateTerminateJobRequest(jobId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateTerminateJobRequest(jobId, content, timeOutInSeconds, ocpdate, force, requestConditions, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -2492,7 +2497,7 @@ public virtual async Task TerminateJobAsync(string jobId, RequestConte
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
@@ -2505,14 +2510,15 @@ public virtual async Task TerminateJobAsync(string jobId, RequestConte
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will terminate the Job even if the corresponding nodes have not fully processed the termination. The default value is false.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response TerminateJob(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response TerminateJob(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
@@ -2520,7 +2526,7 @@ public virtual Response TerminateJob(string jobId, RequestContent content, int?
scope.Start();
try
{
- using HttpMessage message = CreateTerminateJobRequest(jobId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateTerminateJobRequest(jobId, content, timeOutInSeconds, ocpdate, force, requestConditions, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -2830,40 +2836,84 @@ public virtual Response GetJobTaskCounts(string jobId, int? timeOutInSeconds, Da
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ /// Creates a Certificate to the specified Account.
+ /// The Certificate to be created.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ public virtual async Task CreateCertificateAsync(BatchCertificate certificate, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(certificate, nameof(certificate));
+
+ using RequestContent content = certificate.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await CreateCertificateAsync(content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ return response;
+ }
+
+ /// Creates a Certificate to the specified Account.
+ /// The Certificate to be created.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ public virtual Response CreateCertificate(BatchCertificate certificate, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(certificate, nameof(certificate));
+
+ using RequestContent content = certificate.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = CreateCertificate(content, timeOutInSeconds, ocpdate, context);
+ return response;
+ }
+
///
- /// [Protocol Method] Deletes a Job Schedule from the specified Account.
+ /// [Protocol Method] Creates a Certificate to the specified Account.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
///
///
- /// The ID of the Job Schedule to delete.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
+ /// is null.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task DeleteJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task CreateCertificateAsync(RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateCertificate");
scope.Start();
try
{
- using HttpMessage message = CreateDeleteJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateCreateCertificateRequest(content, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -2873,40 +2923,42 @@ public virtual async Task DeleteJobScheduleAsync(string jobScheduleId,
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Deletes a Job Schedule from the specified Account.
+ /// [Protocol Method] Creates a Certificate to the specified Account.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
///
///
- /// The ID of the Job Schedule to delete.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
+ /// is null.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response CreateCertificate(RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateCertificate");
scope.Start();
try
{
- using HttpMessage message = CreateDeleteJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateCreateCertificateRequest(content, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -2916,94 +2968,41 @@ public virtual Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSe
}
}
- /// Gets information about the specified Job Schedule.
- /// The ID of the Job Schedule to get.
- /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
- ///
- /// The time the request was issued. Client libraries typically set this to the
- /// current system clock time; set it explicitly if you are calling the REST API
- /// directly.
- ///
- /// An OData $select clause.
- /// An OData $expand clause.
- /// The content to send as the request conditions of the request.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- ///
- public virtual async Task> GetJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, IEnumerable expand = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
-
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await GetJobScheduleAsync(jobScheduleId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context).ConfigureAwait(false);
- return Response.FromValue(BatchJobSchedule.FromResponse(response), response);
- }
-
- /// Gets information about the specified Job Schedule.
- /// The ID of the Job Schedule to get.
- /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
- ///
- /// The time the request was issued. Client libraries typically set this to the
- /// current system clock time; set it explicitly if you are calling the REST API
- /// directly.
- ///
- /// An OData $select clause.
- /// An OData $expand clause.
- /// The content to send as the request conditions of the request.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- ///
- public virtual Response GetJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, IEnumerable expand = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
-
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = GetJobSchedule(jobScheduleId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
- return Response.FromValue(BatchJobSchedule.FromResponse(response), response);
- }
-
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Gets information about the specified Job Schedule.
+ /// [Protocol Method] Cancels a failed deletion of a Certificate from the specified Account.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
- /// -
- ///
- /// Please try the simpler convenience overload with strongly typed models first.
- ///
- ///
///
///
- /// The ID of the Job Schedule to get.
+ /// The algorithm used to derive the thumbprint parameter. This must be sha1.
+ /// The thumbprint of the Certificate being deleted.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
- /// An OData $expand clause.
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task GetJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, IEnumerable expand, RequestConditions requestConditions, RequestContext context)
+ ///
+ public virtual async Task CancelCertificateDeletionAsync(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
+ Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CancelCertificateDeletion");
scope.Start();
try
{
- using HttpMessage message = CreateGetJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
+ using HttpMessage message = CreateCancelCertificateDeletionRequest(thumbprintAlgorithm, thumbprint, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -3013,46 +3012,41 @@ public virtual async Task GetJobScheduleAsync(string jobScheduleId, in
}
}
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Gets information about the specified Job Schedule.
+ /// [Protocol Method] Cancels a failed deletion of a Certificate from the specified Account.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
- /// -
- ///
- /// Please try the simpler convenience overload with strongly typed models first.
- ///
- ///
///
///
- /// The ID of the Job Schedule to get.
+ /// The algorithm used to derive the thumbprint parameter. This must be sha1.
+ /// The thumbprint of the Certificate being deleted.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
- /// An OData $expand clause.
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response GetJobSchedule(string jobScheduleId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, IEnumerable expand, RequestConditions requestConditions, RequestContext context)
+ ///
+ public virtual Response CancelCertificateDeletion(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
+ Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CancelCertificateDeletion");
scope.Start();
try
{
- using HttpMessage message = CreateGetJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
+ using HttpMessage message = CreateCancelCertificateDeletionRequest(thumbprintAlgorithm, thumbprint, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -3062,8 +3056,9 @@ public virtual Response GetJobSchedule(string jobScheduleId, int? timeOutInSecon
}
}
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Updates the properties of the specified Job Schedule.
+ /// [Protocol Method] Deletes a Certificate from the specified Account.
///
/// -
///
@@ -3072,31 +3067,30 @@ public virtual Response GetJobSchedule(string jobScheduleId, int? timeOutInSecon
///
///
///
- /// The ID of the Job Schedule to update.
- /// The content to send as the body of the request.
+ /// The algorithm used to derive the thumbprint parameter. This must be sha1.
+ /// The thumbprint of the Certificate to be deleted.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task UpdateJobScheduleAsync(string jobScheduleId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task DeleteCertificateAsync(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- Argument.AssertNotNull(content, nameof(content));
+ Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.UpdateJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteCertificate");
scope.Start();
try
{
- using HttpMessage message = CreateUpdateJobScheduleRequest(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateDeleteCertificateRequest(thumbprintAlgorithm, thumbprint, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -3106,8 +3100,9 @@ public virtual async Task UpdateJobScheduleAsync(string jobScheduleId,
}
}
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Updates the properties of the specified Job Schedule.
+ /// [Protocol Method] Deletes a Certificate from the specified Account.
///
/// -
///
@@ -3116,31 +3111,30 @@ public virtual async Task UpdateJobScheduleAsync(string jobScheduleId,
///
///
///
- /// The ID of the Job Schedule to update.
- /// The content to send as the body of the request.
+ /// The algorithm used to derive the thumbprint parameter. This must be sha1.
+ /// The thumbprint of the Certificate to be deleted.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response UpdateJobSchedule(string jobScheduleId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response DeleteCertificate(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- Argument.AssertNotNull(content, nameof(content));
+ Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.UpdateJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteCertificate");
scope.Start();
try
{
- using HttpMessage message = CreateUpdateJobScheduleRequest(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateDeleteCertificateRequest(thumbprintAlgorithm, thumbprint, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -3150,72 +3144,56 @@ public virtual Response UpdateJobSchedule(string jobScheduleId, RequestContent c
}
}
- /// Updates the properties of the specified Job Schedule.
- /// The ID of the Job Schedule to update.
- /// A Job Schedule with updated properties.
+ /// Gets information about the specified Certificate.
+ /// The algorithm used to derive the thumbprint parameter. This must be sha1.
+ /// The thumbprint of the Certificate to get.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
+ /// An OData $select clause.
/// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- ///
- /// This fully replaces all the updatable properties of the Job Schedule. For
- /// example, if the schedule property is not specified with this request, then the
- /// Batch service will remove the existing schedule. Changes to a Job Schedule only
- /// impact Jobs created by the schedule after the update has taken place; currently
- /// running Jobs are unaffected.
- ///
- ///
- public virtual async Task ReplaceJobScheduleAsync(string jobScheduleId, BatchJobSchedule jobSchedule, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ ///
+ public virtual async Task> GetCertificateAsync(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- Argument.AssertNotNull(jobSchedule, nameof(jobSchedule));
+ Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint));
- using RequestContent content = jobSchedule.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await ReplaceJobScheduleAsync(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context).ConfigureAwait(false);
- return response;
+ Response response = await GetCertificateAsync(thumbprintAlgorithm, thumbprint, timeOutInSeconds, ocpdate, select, context).ConfigureAwait(false);
+ return Response.FromValue(GetCertificateResponse.FromResponse(response), response);
}
- /// Updates the properties of the specified Job Schedule.
- /// The ID of the Job Schedule to update.
- /// A Job Schedule with updated properties.
+ /// Gets information about the specified Certificate.
+ /// The algorithm used to derive the thumbprint parameter. This must be sha1.
+ /// The thumbprint of the Certificate to get.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
+ /// An OData $select clause.
/// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- ///
- /// This fully replaces all the updatable properties of the Job Schedule. For
- /// example, if the schedule property is not specified with this request, then the
- /// Batch service will remove the existing schedule. Changes to a Job Schedule only
- /// impact Jobs created by the schedule after the update has taken place; currently
- /// running Jobs are unaffected.
- ///
- ///
- public virtual Response ReplaceJobSchedule(string jobScheduleId, BatchJobSchedule jobSchedule, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ ///
+ public virtual Response GetCertificate(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- Argument.AssertNotNull(jobSchedule, nameof(jobSchedule));
+ Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint));
- using RequestContent content = jobSchedule.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = ReplaceJobSchedule(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
- return response;
+ Response response = GetCertificate(thumbprintAlgorithm, thumbprint, timeOutInSeconds, ocpdate, select, context);
+ return Response.FromValue(GetCertificateResponse.FromResponse(response), response);
}
///
- /// [Protocol Method] Updates the properties of the specified Job Schedule.
+ /// [Protocol Method] Gets information about the specified Certificate.
///
/// -
///
@@ -3224,36 +3202,36 @@ public virtual Response ReplaceJobSchedule(string jobScheduleId, BatchJobSchedul
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
- /// The ID of the Job Schedule to update.
- /// The content to send as the body of the request.
+ /// The algorithm used to derive the thumbprint parameter. This must be sha1.
+ /// The thumbprint of the Certificate to get.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
+ /// An OData $select clause.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task ReplaceJobScheduleAsync(string jobScheduleId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task GetCertificateAsync(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, RequestContext context)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- Argument.AssertNotNull(content, nameof(content));
+ Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetCertificate");
scope.Start();
try
{
- using HttpMessage message = CreateReplaceJobScheduleRequest(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateGetCertificateRequest(thumbprintAlgorithm, thumbprint, timeOutInSeconds, ocpdate, select, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -3264,7 +3242,7 @@ public virtual async Task ReplaceJobScheduleAsync(string jobScheduleId
}
///
- /// [Protocol Method] Updates the properties of the specified Job Schedule.
+ /// [Protocol Method] Gets information about the specified Certificate.
///
/// -
///
@@ -3273,36 +3251,36 @@ public virtual async Task ReplaceJobScheduleAsync(string jobScheduleId
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
- /// The ID of the Job Schedule to update.
- /// The content to send as the body of the request.
+ /// The algorithm used to derive the thumbprint parameter. This must be sha1.
+ /// The thumbprint of the Certificate to get.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
+ /// An OData $select clause.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response ReplaceJobSchedule(string jobScheduleId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response GetCertificate(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, RequestContext context)
{
- Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- Argument.AssertNotNull(content, nameof(content));
+ Argument.AssertNotNullOrEmpty(thumbprintAlgorithm, nameof(thumbprintAlgorithm));
+ Argument.AssertNotNullOrEmpty(thumbprint, nameof(thumbprint));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetCertificate");
scope.Start();
try
{
- using HttpMessage message = CreateReplaceJobScheduleRequest(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateGetCertificateRequest(thumbprintAlgorithm, thumbprint, timeOutInSeconds, ocpdate, select, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -3314,7 +3292,7 @@ public virtual Response ReplaceJobSchedule(string jobScheduleId, RequestContent
// The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Disables a Job Schedule.
+ /// [Protocol Method] Deletes a Job Schedule from the specified Account.
///
/// -
///
@@ -3323,29 +3301,30 @@ public virtual Response ReplaceJobSchedule(string jobScheduleId, RequestContent
///
///
///
- /// The ID of the Job Schedule to disable.
+ /// The ID of the Job Schedule to delete.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will delete the JobSchedule even if the corresponding nodes have not fully processed the deletion. The default value is false.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task DisableJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task DeleteJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DisableJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateDisableJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateDeleteJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, force, requestConditions, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -3357,7 +3336,7 @@ public virtual async Task DisableJobScheduleAsync(string jobScheduleId
// The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Disables a Job Schedule.
+ /// [Protocol Method] Deletes a Job Schedule from the specified Account.
///
/// -
///
@@ -3366,29 +3345,30 @@ public virtual async Task DisableJobScheduleAsync(string jobScheduleId
///
///
///
- /// The ID of the Job Schedule to disable.
+ /// The ID of the Job Schedule to delete.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will delete the JobSchedule even if the corresponding nodes have not fully processed the deletion. The default value is false.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response DisableJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response DeleteJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DisableJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateDisableJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateDeleteJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, force, requestConditions, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -3398,40 +3378,94 @@ public virtual Response DisableJobSchedule(string jobScheduleId, int? timeOutInS
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
- ///
- /// [Protocol Method] Enables a Job Schedule.
+ /// Gets information about the specified Job Schedule.
+ /// The ID of the Job Schedule to get.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// An OData $select clause.
+ /// An OData $expand clause.
+ /// The content to send as the request conditions of the request.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual async Task> GetJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, IEnumerable expand = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetJobScheduleAsync(jobScheduleId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context).ConfigureAwait(false);
+ return Response.FromValue(BatchJobSchedule.FromResponse(response), response);
+ }
+
+ /// Gets information about the specified Job Schedule.
+ /// The ID of the Job Schedule to get.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// An OData $select clause.
+ /// An OData $expand clause.
+ /// The content to send as the request conditions of the request.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual Response GetJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, IEnumerable expand = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetJobSchedule(jobScheduleId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
+ return Response.FromValue(BatchJobSchedule.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Gets information about the specified Job Schedule.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
///
///
- /// The ID of the Job Schedule to enable.
+ /// The ID of the Job Schedule to get.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// An OData $select clause.
+ /// An OData $expand clause.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task EnableJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task GetJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, IEnumerable expand, RequestConditions requestConditions, RequestContext context)
{
Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.EnableJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateEnableJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateGetJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -3441,40 +3475,46 @@ public virtual async Task EnableJobScheduleAsync(string jobScheduleId,
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Enables a Job Schedule.
+ /// [Protocol Method] Gets information about the specified Job Schedule.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
///
///
- /// The ID of the Job Schedule to enable.
+ /// The ID of the Job Schedule to get.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// An OData $select clause.
+ /// An OData $expand clause.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response EnableJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response GetJobSchedule(string jobScheduleId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, IEnumerable expand, RequestConditions requestConditions, RequestContext context)
{
Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.EnableJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateEnableJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateGetJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -3484,9 +3524,8 @@ public virtual Response EnableJobSchedule(string jobScheduleId, int? timeOutInSe
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Terminates a Job Schedule.
+ /// [Protocol Method] Updates the properties of the specified Job Schedule.
///
/// -
///
@@ -3495,7 +3534,8 @@ public virtual Response EnableJobSchedule(string jobScheduleId, int? timeOutInSe
///
///
///
- /// The ID of the Job Schedule to terminates.
+ /// The ID of the Job Schedule to update.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -3504,20 +3544,21 @@ public virtual Response EnableJobSchedule(string jobScheduleId, int? timeOutInSe
///
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// is null.
+ /// or is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task TerminateJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task UpdateJobScheduleAsync(string jobScheduleId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.TerminateJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.UpdateJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateTerminateJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateUpdateJobScheduleRequest(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -3527,9 +3568,8 @@ public virtual async Task TerminateJobScheduleAsync(string jobSchedule
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Terminates a Job Schedule.
+ /// [Protocol Method] Updates the properties of the specified Job Schedule.
///
/// -
///
@@ -3538,7 +3578,8 @@ public virtual async Task TerminateJobScheduleAsync(string jobSchedule
///
///
///
- /// The ID of the Job Schedule to terminates.
+ /// The ID of the Job Schedule to update.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -3547,20 +3588,21 @@ public virtual async Task TerminateJobScheduleAsync(string jobSchedule
///
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// is null.
+ /// or is null.
/// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response TerminateJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response UpdateJobSchedule(string jobScheduleId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.TerminateJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.UpdateJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateTerminateJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateUpdateJobScheduleRequest(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -3570,50 +3612,72 @@ public virtual Response TerminateJobSchedule(string jobScheduleId, int? timeOutI
}
}
- /// Creates a Job Schedule to the specified Account.
- /// The Job Schedule to be created.
+ /// Updates the properties of the specified Job Schedule.
+ /// The ID of the Job Schedule to update.
+ /// A Job Schedule with updated properties.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// The content to send as the request conditions of the request.
/// The cancellation token to use.
- /// is null.
- ///
- public virtual async Task CreateJobScheduleAsync(BatchJobScheduleCreateContent jobSchedule, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ /// This fully replaces all the updatable properties of the Job Schedule. For
+ /// example, if the schedule property is not specified with this request, then the
+ /// Batch service will remove the existing schedule. Changes to a Job Schedule only
+ /// impact Jobs created by the schedule after the update has taken place; currently
+ /// running Jobs are unaffected.
+ ///
+ ///
+ public virtual async Task ReplaceJobScheduleAsync(string jobScheduleId, BatchJobSchedule jobSchedule, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
{
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
Argument.AssertNotNull(jobSchedule, nameof(jobSchedule));
using RequestContent content = jobSchedule.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await CreateJobScheduleAsync(content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ Response response = await ReplaceJobScheduleAsync(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context).ConfigureAwait(false);
return response;
}
- /// Creates a Job Schedule to the specified Account.
- /// The Job Schedule to be created.
+ /// Updates the properties of the specified Job Schedule.
+ /// The ID of the Job Schedule to update.
+ /// A Job Schedule with updated properties.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// The content to send as the request conditions of the request.
/// The cancellation token to use.
- /// is null.
- ///
- public virtual Response CreateJobSchedule(BatchJobScheduleCreateContent jobSchedule, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ /// This fully replaces all the updatable properties of the Job Schedule. For
+ /// example, if the schedule property is not specified with this request, then the
+ /// Batch service will remove the existing schedule. Changes to a Job Schedule only
+ /// impact Jobs created by the schedule after the update has taken place; currently
+ /// running Jobs are unaffected.
+ ///
+ ///
+ public virtual Response ReplaceJobSchedule(string jobScheduleId, BatchJobSchedule jobSchedule, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
{
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
Argument.AssertNotNull(jobSchedule, nameof(jobSchedule));
using RequestContent content = jobSchedule.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = CreateJobSchedule(content, timeOutInSeconds, ocpdate, context);
+ Response response = ReplaceJobSchedule(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
return response;
}
///
- /// [Protocol Method] Creates a Job Schedule to the specified Account.
+ /// [Protocol Method] Updates the properties of the specified Job Schedule.
///
/// -
///
@@ -3622,11 +3686,12 @@ public virtual Response CreateJobSchedule(BatchJobScheduleCreateContent jobSched
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
+ /// The ID of the Job Schedule to update.
/// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
@@ -3634,20 +3699,23 @@ public virtual Response CreateJobSchedule(BatchJobScheduleCreateContent jobSched
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// is null.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task CreateJobScheduleAsync(RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual async Task ReplaceJobScheduleAsync(string jobScheduleId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateCreateJobScheduleRequest(content, timeOutInSeconds, ocpdate, context);
+ using HttpMessage message = CreateReplaceJobScheduleRequest(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -3658,7 +3726,7 @@ public virtual async Task CreateJobScheduleAsync(RequestContent conten
}
///
- /// [Protocol Method] Creates a Job Schedule to the specified Account.
+ /// [Protocol Method] Updates the properties of the specified Job Schedule.
///
/// -
///
@@ -3667,11 +3735,12 @@ public virtual async Task CreateJobScheduleAsync(RequestContent conten
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
+ /// The ID of the Job Schedule to update.
/// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
@@ -3679,20 +3748,23 @@ public virtual async Task CreateJobScheduleAsync(RequestContent conten
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// is null.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response CreateJobSchedule(RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual Response ReplaceJobSchedule(string jobScheduleId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateJobSchedule");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateCreateJobScheduleRequest(content, timeOutInSeconds, ocpdate, context);
+ using HttpMessage message = CreateReplaceJobScheduleRequest(jobScheduleId, content, timeOutInSeconds, ocpdate, requestConditions, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -3702,104 +3774,84 @@ public virtual Response CreateJobSchedule(RequestContent content, int? timeOutIn
}
}
- /// Creates a Task to the specified Job.
- /// The ID of the Job to which the Task is to be created.
- /// The Task to be created.
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Disables a Job Schedule.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job Schedule to disable.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- ///
- /// The maximum lifetime of a Task from addition to completion is 180 days. If a
- /// Task has not completed within 180 days of being added it will be terminated by
- /// the Batch service and left in whatever state it was in at that time.
- ///
- ///
- public virtual async Task CreateTaskAsync(string jobId, BatchTaskCreateContent task, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task DisableJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNull(task, nameof(task));
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using RequestContent content = task.ToRequestContent();
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await CreateTaskAsync(jobId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
- return response;
- }
-
- /// Creates a Task to the specified Job.
- /// The ID of the Job to which the Task is to be created.
- /// The Task to be created.
- /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
- ///
- /// The time the request was issued. Client libraries typically set this to the
- /// current system clock time; set it explicitly if you are calling the REST API
- /// directly.
- ///
- /// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- ///
- /// The maximum lifetime of a Task from addition to completion is 180 days. If a
- /// Task has not completed within 180 days of being added it will be terminated by
- /// the Batch service and left in whatever state it was in at that time.
- ///
- ///
- public virtual Response CreateTask(string jobId, BatchTaskCreateContent task, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNull(task, nameof(task));
-
- using RequestContent content = task.ToRequestContent();
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = CreateTask(jobId, content, timeOutInSeconds, ocpdate, context);
- return response;
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DisableJobSchedule");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDisableJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
}
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Creates a Task to the specified Job.
+ /// [Protocol Method] Disables a Job Schedule.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
- /// -
- ///
- /// Please try the simpler convenience overload with strongly typed models first.
- ///
- ///
///
///
- /// The ID of the Job to which the Task is to be created.
- /// The content to send as the body of the request.
+ /// The ID of the Job Schedule to disable.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task CreateTaskAsync(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual Response DisableJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNull(content, nameof(content));
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DisableJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateCreateTaskRequest(jobId, content, timeOutInSeconds, ocpdate, context);
- return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ using HttpMessage message = CreateDisableJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
{
@@ -3808,46 +3860,41 @@ public virtual async Task CreateTaskAsync(string jobId, RequestContent
}
}
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Creates a Task to the specified Job.
+ /// [Protocol Method] Enables a Job Schedule.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
- /// -
- ///
- /// Please try the simpler convenience overload with strongly typed models first.
- ///
- ///
///
///
- /// The ID of the Job to which the Task is to be created.
- /// The content to send as the body of the request.
+ /// The ID of the Job Schedule to enable.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response CreateTask(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual async Task EnableJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNull(content, nameof(content));
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.EnableJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateCreateTaskRequest(jobId, content, timeOutInSeconds, ocpdate, context);
- return _pipeline.ProcessMessage(message, context);
+ using HttpMessage message = CreateEnableJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
{
@@ -3856,126 +3903,41 @@ public virtual Response CreateTask(string jobId, RequestContent content, int? ti
}
}
- /// Adds a collection of Tasks to the specified Job.
- /// The ID of the Job to which the Task collection is to be added.
- /// The Tasks to be added.
- /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
- ///
- /// The time the request was issued. Client libraries typically set this to the
- /// current system clock time; set it explicitly if you are calling the REST API
- /// directly.
- ///
- /// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- ///
- /// Note that each Task must have a unique ID. The Batch service may not return the
- /// results for each Task in the same order the Tasks were submitted in this
- /// request. If the server times out or the connection is closed during the
- /// request, the request may have been partially or fully processed, or not at all.
- /// In such cases, the user should re-issue the request. Note that it is up to the
- /// user to correctly handle failures when re-issuing a request. For example, you
- /// should use the same Task IDs during a retry so that if the prior operation
- /// succeeded, the retry will not create extra Tasks unexpectedly. If the response
- /// contains any Tasks which failed to add, a client can retry the request. In a
- /// retry, it is most efficient to resubmit only Tasks that failed to add, and to
- /// omit Tasks that were successfully added on the first attempt. The maximum
- /// lifetime of a Task from addition to completion is 180 days. If a Task has not
- /// completed within 180 days of being added it will be terminated by the Batch
- /// service and left in whatever state it was in at that time.
- ///
- ///
- public virtual async Task> CreateTaskCollectionAsync(string jobId, BatchTaskGroup taskCollection, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNull(taskCollection, nameof(taskCollection));
-
- using RequestContent content = taskCollection.ToRequestContent();
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await CreateTaskCollectionAsync(jobId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
- return Response.FromValue(BatchTaskAddCollectionResult.FromResponse(response), response);
- }
-
- /// Adds a collection of Tasks to the specified Job.
- /// The ID of the Job to which the Task collection is to be added.
- /// The Tasks to be added.
- /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
- ///
- /// The time the request was issued. Client libraries typically set this to the
- /// current system clock time; set it explicitly if you are calling the REST API
- /// directly.
- ///
- /// The cancellation token to use.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
- ///
- /// Note that each Task must have a unique ID. The Batch service may not return the
- /// results for each Task in the same order the Tasks were submitted in this
- /// request. If the server times out or the connection is closed during the
- /// request, the request may have been partially or fully processed, or not at all.
- /// In such cases, the user should re-issue the request. Note that it is up to the
- /// user to correctly handle failures when re-issuing a request. For example, you
- /// should use the same Task IDs during a retry so that if the prior operation
- /// succeeded, the retry will not create extra Tasks unexpectedly. If the response
- /// contains any Tasks which failed to add, a client can retry the request. In a
- /// retry, it is most efficient to resubmit only Tasks that failed to add, and to
- /// omit Tasks that were successfully added on the first attempt. The maximum
- /// lifetime of a Task from addition to completion is 180 days. If a Task has not
- /// completed within 180 days of being added it will be terminated by the Batch
- /// service and left in whatever state it was in at that time.
- ///
- ///
- public virtual Response CreateTaskCollection(string jobId, BatchTaskGroup taskCollection, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNull(taskCollection, nameof(taskCollection));
-
- using RequestContent content = taskCollection.ToRequestContent();
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = CreateTaskCollection(jobId, content, timeOutInSeconds, ocpdate, context);
- return Response.FromValue(BatchTaskAddCollectionResult.FromResponse(response), response);
- }
-
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Adds a collection of Tasks to the specified Job.
+ /// [Protocol Method] Enables a Job Schedule.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
- /// -
- ///
- /// Please try the simpler convenience overload with strongly typed models first.
- ///
- ///
///
///
- /// The ID of the Job to which the Task collection is to be added.
- /// The content to send as the body of the request.
+ /// The ID of the Job Schedule to enable.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task CreateTaskCollectionAsync(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual Response EnableJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNull(content, nameof(content));
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateTaskCollection");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.EnableJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateCreateTaskCollectionRequest(jobId, content, timeOutInSeconds, ocpdate, context);
- return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ using HttpMessage message = CreateEnableJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, requestConditions, context);
+ return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
{
@@ -3984,46 +3946,42 @@ public virtual async Task CreateTaskCollectionAsync(string jobId, Requ
}
}
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Adds a collection of Tasks to the specified Job.
+ /// [Protocol Method] Terminates a Job Schedule.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
- /// -
- ///
- /// Please try the simpler convenience overload with strongly typed models first.
- ///
- ///
///
///
- /// The ID of the Job to which the Task collection is to be added.
- /// The content to send as the body of the request.
+ /// The ID of the Job Schedule to terminates.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will terminate the JobSchedule even if the corresponding nodes have not fully processed the termination. The default value is false.
+ /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response CreateTaskCollection(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual async Task TerminateJobScheduleAsync(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNull(content, nameof(content));
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateTaskCollection");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.TerminateJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateCreateTaskCollectionRequest(jobId, content, timeOutInSeconds, ocpdate, context);
- return _pipeline.ProcessMessage(message, context);
+ using HttpMessage message = CreateTerminateJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, force, requestConditions, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
{
@@ -4034,7 +3992,7 @@ public virtual Response CreateTaskCollection(string jobId, RequestContent conten
// The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Deletes a Task from the specified Job.
+ /// [Protocol Method] Terminates a Job Schedule.
///
/// -
///
@@ -4043,32 +4001,31 @@ public virtual Response CreateTaskCollection(string jobId, RequestContent conten
///
///
///
- /// The ID of the Job from which to delete the Task.
- /// The ID of the Task to delete.
+ /// The ID of the Job Schedule to terminates.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// If true, the server will terminate the JobSchedule even if the corresponding nodes have not fully processed the termination. The default value is false.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task DeleteTaskAsync(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response TerminateJobSchedule(string jobScheduleId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? force = null, RequestConditions requestConditions = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(jobScheduleId, nameof(jobScheduleId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.TerminateJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateDeleteTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
- return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ using HttpMessage message = CreateTerminateJobScheduleRequest(jobScheduleId, timeOutInSeconds, ocpdate, force, requestConditions, context);
+ return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
{
@@ -4077,115 +4034,50 @@ public virtual async Task DeleteTaskAsync(string jobId, string taskId,
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
- ///
- /// [Protocol Method] Deletes a Task from the specified Job.
- ///
- /// -
- ///
- /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- ///
- ///
- ///
- ///
- /// The ID of the Job from which to delete the Task.
- /// The ID of the Task to delete.
+ /// Creates a Job Schedule to the specified Account.
+ /// The Job Schedule to be created.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
- /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
- /// Service returned a non-success status code.
- /// The response returned from the service.
- ///
- public virtual Response DeleteTask(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
- {
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
-
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteTask");
- scope.Start();
- try
- {
- using HttpMessage message = CreateDeleteTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
- return _pipeline.ProcessMessage(message, context);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- /// Gets information about the specified Task.
- /// The ID of the Job that contains the Task.
- /// The ID of the Task to get information about.
- /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
- ///
- /// The time the request was issued. Client libraries typically set this to the
- /// current system clock time; set it explicitly if you are calling the REST API
- /// directly.
- ///
- /// An OData $select clause.
- /// An OData $expand clause.
- /// The content to send as the request conditions of the request.
/// The cancellation token to use.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
- ///
- /// For multi-instance Tasks, information such as affinityId, executionInfo and
- /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve
- /// information about subtasks.
- ///
- ///
- public virtual async Task> GetTaskAsync(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, IEnumerable expand = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ /// is null.
+ ///
+ public virtual async Task CreateJobScheduleAsync(BatchJobScheduleCreateContent jobSchedule, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(jobSchedule, nameof(jobSchedule));
+ using RequestContent content = jobSchedule.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await GetTaskAsync(jobId, taskId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context).ConfigureAwait(false);
- return Response.FromValue(BatchTask.FromResponse(response), response);
+ Response response = await CreateJobScheduleAsync(content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ return response;
}
- /// Gets information about the specified Task.
- /// The ID of the Job that contains the Task.
- /// The ID of the Task to get information about.
+ /// Creates a Job Schedule to the specified Account.
+ /// The Job Schedule to be created.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
- /// An OData $expand clause.
- /// The content to send as the request conditions of the request.
/// The cancellation token to use.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
- ///
- /// For multi-instance Tasks, information such as affinityId, executionInfo and
- /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve
- /// information about subtasks.
- ///
- ///
- public virtual Response GetTask(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, IEnumerable expand = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ /// is null.
+ ///
+ public virtual Response CreateJobSchedule(BatchJobScheduleCreateContent jobSchedule, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(jobSchedule, nameof(jobSchedule));
+ using RequestContent content = jobSchedule.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = GetTask(jobId, taskId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
- return Response.FromValue(BatchTask.FromResponse(response), response);
+ Response response = CreateJobSchedule(content, timeOutInSeconds, ocpdate, context);
+ return response;
}
///
- /// [Protocol Method] Gets information about the specified Task.
+ /// [Protocol Method] Creates a Job Schedule to the specified Account.
///
/// -
///
@@ -4194,38 +4086,32 @@ public virtual Response GetTask(string jobId, string taskId, int? tim
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
- /// The ID of the Job that contains the Task.
- /// The ID of the Task to get information about.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
- /// An OData $expand clause.
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
+ /// is null.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task GetTaskAsync(string jobId, string taskId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, IEnumerable expand, RequestConditions requestConditions, RequestContext context)
+ ///
+ public virtual async Task CreateJobScheduleAsync(RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateGetTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
+ using HttpMessage message = CreateCreateJobScheduleRequest(content, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -4236,7 +4122,7 @@ public virtual async Task GetTaskAsync(string jobId, string taskId, in
}
///
- /// [Protocol Method] Gets information about the specified Task.
+ /// [Protocol Method] Creates a Job Schedule to the specified Account.
///
/// -
///
@@ -4245,38 +4131,32 @@ public virtual async Task GetTaskAsync(string jobId, string taskId, in
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
- /// The ID of the Job that contains the Task.
- /// The ID of the Task to get information about.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
- /// An OData $expand clause.
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
+ /// is null.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response GetTask(string jobId, string taskId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, IEnumerable expand, RequestConditions requestConditions, RequestContext context)
+ ///
+ public virtual Response CreateJobSchedule(RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateJobSchedule");
scope.Start();
try
{
- using HttpMessage message = CreateGetTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
+ using HttpMessage message = CreateCreateJobScheduleRequest(content, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -4286,62 +4166,66 @@ public virtual Response GetTask(string jobId, string taskId, int? timeOutInSecon
}
}
- /// Updates the properties of the specified Task.
- /// The ID of the Job containing the Task.
- /// The ID of the Task to update.
- /// The Task to update.
+ /// Creates a Task to the specified Job.
+ /// The ID of the Job to which the Task is to be created.
+ /// The Task to be created.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The cancellation token to use.
- /// , or is null.
- /// or is an empty string, and was expected to be non-empty.
- ///
- public virtual async Task ReplaceTaskAsync(string jobId, string taskId, BatchTask task, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ /// The maximum lifetime of a Task from addition to completion is 180 days. If a
+ /// Task has not completed within 180 days of being added it will be terminated by
+ /// the Batch service and left in whatever state it was in at that time.
+ ///
+ ///
+ public virtual async Task CreateTaskAsync(string jobId, BatchTaskCreateContent task, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
Argument.AssertNotNull(task, nameof(task));
using RequestContent content = task.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await ReplaceTaskAsync(jobId, taskId, content, timeOutInSeconds, ocpdate, requestConditions, context).ConfigureAwait(false);
+ Response response = await CreateTaskAsync(jobId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
return response;
}
- /// Updates the properties of the specified Task.
- /// The ID of the Job containing the Task.
- /// The ID of the Task to update.
- /// The Task to update.
+ /// Creates a Task to the specified Job.
+ /// The ID of the Job to which the Task is to be created.
+ /// The Task to be created.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The cancellation token to use.
- /// , or is null.
- /// or is an empty string, and was expected to be non-empty.
- ///
- public virtual Response ReplaceTask(string jobId, string taskId, BatchTask task, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ /// The maximum lifetime of a Task from addition to completion is 180 days. If a
+ /// Task has not completed within 180 days of being added it will be terminated by
+ /// the Batch service and left in whatever state it was in at that time.
+ ///
+ ///
+ public virtual Response CreateTask(string jobId, BatchTaskCreateContent task, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
Argument.AssertNotNull(task, nameof(task));
using RequestContent content = task.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = ReplaceTask(jobId, taskId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ Response response = CreateTask(jobId, content, timeOutInSeconds, ocpdate, context);
return response;
}
///
- /// [Protocol Method] Updates the properties of the specified Task.
+ /// [Protocol Method] Creates a Task to the specified Job.
///
/// -
///
@@ -4350,13 +4234,12 @@ public virtual Response ReplaceTask(string jobId, string taskId, BatchTask task,
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
- /// The ID of the Job containing the Task.
- /// The ID of the Task to update.
+ /// The ID of the Job to which the Task is to be created.
/// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
@@ -4364,24 +4247,22 @@ public virtual Response ReplaceTask(string jobId, string taskId, BatchTask task,
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task ReplaceTaskAsync(string jobId, string taskId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task CreateTaskAsync(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateTask");
scope.Start();
try
{
- using HttpMessage message = CreateReplaceTaskRequest(jobId, taskId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateCreateTaskRequest(jobId, content, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -4392,7 +4273,7 @@ public virtual async Task ReplaceTaskAsync(string jobId, string taskId
}
///
- /// [Protocol Method] Updates the properties of the specified Task.
+ /// [Protocol Method] Creates a Task to the specified Job.
///
/// -
///
@@ -4401,13 +4282,12 @@ public virtual async Task ReplaceTaskAsync(string jobId, string taskId
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
- /// The ID of the Job containing the Task.
- /// The ID of the Task to update.
+ /// The ID of the Job to which the Task is to be created.
/// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
@@ -4415,24 +4295,22 @@ public virtual async Task ReplaceTaskAsync(string jobId, string taskId
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response ReplaceTask(string jobId, string taskId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response CreateTask(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateTask");
scope.Start();
try
{
- using HttpMessage message = CreateReplaceTaskRequest(jobId, taskId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateCreateTaskRequest(jobId, content, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -4442,133 +4320,125 @@ public virtual Response ReplaceTask(string jobId, string taskId, RequestContent
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
- ///
- /// [Protocol Method] Terminates the specified Task.
- ///
- /// -
- ///
- /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- ///
- ///
- ///
- ///
- /// The ID of the Job containing the Task.
- /// The ID of the Task to terminate.
+ /// Adds a collection of Tasks to the specified Job.
+ /// The ID of the Job to which the Task collection is to be added.
+ /// The Tasks to be added.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
- /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
- /// Service returned a non-success status code.
- /// The response returned from the service.
- ///
- public virtual async Task TerminateTaskAsync(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
- {
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
-
- using var scope = ClientDiagnostics.CreateScope("BatchClient.TerminateTask");
- scope.Start();
- try
- {
- using HttpMessage message = CreateTerminateTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
- return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ /// Note that each Task must have a unique ID. The Batch service may not return the
+ /// results for each Task in the same order the Tasks were submitted in this
+ /// request. If the server times out or the connection is closed during the
+ /// request, the request may have been partially or fully processed, or not at all.
+ /// In such cases, the user should re-issue the request. Note that it is up to the
+ /// user to correctly handle failures when re-issuing a request. For example, you
+ /// should use the same Task IDs during a retry so that if the prior operation
+ /// succeeded, the retry will not create extra Tasks unexpectedly. If the response
+ /// contains any Tasks which failed to add, a client can retry the request. In a
+ /// retry, it is most efficient to resubmit only Tasks that failed to add, and to
+ /// omit Tasks that were successfully added on the first attempt. The maximum
+ /// lifetime of a Task from addition to completion is 180 days. If a Task has not
+ /// completed within 180 days of being added it will be terminated by the Batch
+ /// service and left in whatever state it was in at that time.
+ ///
+ ///
+ public virtual async Task> CreateTaskCollectionAsync(string jobId, BatchTaskGroup taskCollection, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNull(taskCollection, nameof(taskCollection));
+
+ using RequestContent content = taskCollection.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await CreateTaskCollectionAsync(jobId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ return Response.FromValue(BatchTaskAddCollectionResult.FromResponse(response), response);
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
- ///
- /// [Protocol Method] Terminates the specified Task.
- ///
- /// -
- ///
- /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- ///
- ///
- ///
- ///
- /// The ID of the Job containing the Task.
- /// The ID of the Task to terminate.
+ /// Adds a collection of Tasks to the specified Job.
+ /// The ID of the Job to which the Task collection is to be added.
+ /// The Tasks to be added.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
- /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
- /// Service returned a non-success status code.
- /// The response returned from the service.
- ///
- public virtual Response TerminateTask(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ /// Note that each Task must have a unique ID. The Batch service may not return the
+ /// results for each Task in the same order the Tasks were submitted in this
+ /// request. If the server times out or the connection is closed during the
+ /// request, the request may have been partially or fully processed, or not at all.
+ /// In such cases, the user should re-issue the request. Note that it is up to the
+ /// user to correctly handle failures when re-issuing a request. For example, you
+ /// should use the same Task IDs during a retry so that if the prior operation
+ /// succeeded, the retry will not create extra Tasks unexpectedly. If the response
+ /// contains any Tasks which failed to add, a client can retry the request. In a
+ /// retry, it is most efficient to resubmit only Tasks that failed to add, and to
+ /// omit Tasks that were successfully added on the first attempt. The maximum
+ /// lifetime of a Task from addition to completion is 180 days. If a Task has not
+ /// completed within 180 days of being added it will be terminated by the Batch
+ /// service and left in whatever state it was in at that time.
+ ///
+ ///
+ public virtual Response CreateTaskCollection(string jobId, BatchTaskGroup taskCollection, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(taskCollection, nameof(taskCollection));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.TerminateTask");
- scope.Start();
- try
- {
- using HttpMessage message = CreateTerminateTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
- return _pipeline.ProcessMessage(message, context);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
+ using RequestContent content = taskCollection.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = CreateTaskCollection(jobId, content, timeOutInSeconds, ocpdate, context);
+ return Response.FromValue(BatchTaskAddCollectionResult.FromResponse(response), response);
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Reactivates a Task, allowing it to run again even if its retry count has been
- /// exhausted.
+ /// [Protocol Method] Adds a collection of Tasks to the specified Job.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
///
///
- /// The ID of the Job containing the Task.
- /// The ID of the Task to reactivate.
+ /// The ID of the Job to which the Task collection is to be added.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task ReactivateTaskAsync(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task CreateTaskCollectionAsync(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.ReactivateTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateTaskCollection");
scope.Start();
try
{
- using HttpMessage message = CreateReactivateTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateCreateTaskCollectionRequest(jobId, content, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -4578,43 +4448,45 @@ public virtual async Task ReactivateTaskAsync(string jobId, string tas
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Reactivates a Task, allowing it to run again even if its retry count has been
- /// exhausted.
+ /// [Protocol Method] Adds a collection of Tasks to the specified Job.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
///
///
- /// The ID of the Job containing the Task.
- /// The ID of the Task to reactivate.
+ /// The ID of the Job to which the Task collection is to be added.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// or is null.
- /// or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response ReactivateTask(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual Response CreateTaskCollection(string jobId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.ReactivateTask");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateTaskCollection");
scope.Start();
try
{
- using HttpMessage message = CreateReactivateTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateCreateTaskCollectionRequest(jobId, content, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -4626,7 +4498,7 @@ public virtual Response ReactivateTask(string jobId, string taskId, int? timeOut
// The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Deletes the specified Task file from the Compute Node where the Task ran.
+ /// [Protocol Method] Deletes a Task from the specified Job.
///
/// -
///
@@ -4635,38 +4507,31 @@ public virtual Response ReactivateTask(string jobId, string taskId, int? timeOut
///
///
///
- /// The ID of the Job that contains the Task.
- /// The ID of the Task whose file you want to retrieve.
- /// The path to the Task file that you want to get the content of.
+ /// The ID of the Job from which to delete the Task.
+ /// The ID of the Task to delete.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- ///
- /// Whether to delete children of a directory. If the filePath parameter represents
- /// a directory instead of a file, you can set recursive to true to delete the
- /// directory and all of the files and subdirectories in it. If recursive is false
- /// then the directory must be empty or deletion will fail.
- ///
+ /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task DeleteTaskFileAsync(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? recursive = null, RequestContext context = null)
+ ///
+ public virtual async Task DeleteTaskAsync(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
- Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteTaskFile");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteTask");
scope.Start();
try
{
- using HttpMessage message = CreateDeleteTaskFileRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, recursive, context);
+ using HttpMessage message = CreateDeleteTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -4678,7 +4543,7 @@ public virtual async Task DeleteTaskFileAsync(string jobId, string tas
// The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Deletes the specified Task file from the Compute Node where the Task ran.
+ /// [Protocol Method] Deletes a Task from the specified Job.
///
/// -
///
@@ -4687,38 +4552,31 @@ public virtual async Task DeleteTaskFileAsync(string jobId, string tas
///
///
///
- /// The ID of the Job that contains the Task.
- /// The ID of the Task whose file you want to retrieve.
- /// The path to the Task file that you want to get the content of.
+ /// The ID of the Job from which to delete the Task.
+ /// The ID of the Task to delete.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- ///
- /// Whether to delete children of a directory. If the filePath parameter represents
- /// a directory instead of a file, you can set recursive to true to delete the
- /// directory and all of the files and subdirectories in it. If recursive is false
- /// then the directory must be empty or deletion will fail.
- ///
+ /// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response DeleteTaskFile(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? recursive = null, RequestContext context = null)
+ ///
+ public virtual Response DeleteTask(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
- Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteTaskFile");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteTask");
scope.Start();
try
{
- using HttpMessage message = CreateDeleteTaskFileRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, recursive, context);
+ using HttpMessage message = CreateDeleteTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -4728,68 +4586,70 @@ public virtual Response DeleteTaskFile(string jobId, string taskId, string fileP
}
}
- /// Returns the content of the specified Task file.
+ /// Gets information about the specified Task.
/// The ID of the Job that contains the Task.
- /// The ID of the Task whose file you want to retrieve.
- /// The path to the Task file that you want to get the content of.
+ /// The ID of the Task to get information about.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- ///
- /// The byte range to be retrieved. The default is to retrieve the entire file. The
- /// format is bytes=startRange-endRange.
- ///
+ /// An OData $select clause.
+ /// An OData $expand clause.
/// The content to send as the request conditions of the request.
/// The cancellation token to use.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
- ///
- public virtual async Task> GetTaskFileAsync(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, string ocpRange = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ ///
+ /// For multi-instance Tasks, information such as affinityId, executionInfo and
+ /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve
+ /// information about subtasks.
+ ///
+ ///
+ public virtual async Task> GetTaskAsync(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, IEnumerable expand = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
- Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await GetTaskFileAsync(jobId, taskId, filePath, timeOutInSeconds, ocpdate, ocpRange, requestConditions, context).ConfigureAwait(false);
- return Response.FromValue(response.Content, response);
+ Response response = await GetTaskAsync(jobId, taskId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context).ConfigureAwait(false);
+ return Response.FromValue(BatchTask.FromResponse(response), response);
}
- /// Returns the content of the specified Task file.
+ /// Gets information about the specified Task.
/// The ID of the Job that contains the Task.
- /// The ID of the Task whose file you want to retrieve.
- /// The path to the Task file that you want to get the content of.
+ /// The ID of the Task to get information about.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- ///
- /// The byte range to be retrieved. The default is to retrieve the entire file. The
- /// format is bytes=startRange-endRange.
- ///
+ /// An OData $select clause.
+ /// An OData $expand clause.
/// The content to send as the request conditions of the request.
/// The cancellation token to use.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
- ///
- public virtual Response GetTaskFile(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, string ocpRange = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
- Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
- Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
-
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = GetTaskFile(jobId, taskId, filePath, timeOutInSeconds, ocpdate, ocpRange, requestConditions, context);
- return Response.FromValue(response.Content, response);
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ ///
+ /// For multi-instance Tasks, information such as affinityId, executionInfo and
+ /// nodeInfo refer to the primary Task. Use the list subtasks API to retrieve
+ /// information about subtasks.
+ ///
+ ///
+ public virtual Response GetTask(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, IEnumerable expand = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetTask(jobId, taskId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
+ return Response.FromValue(BatchTask.FromResponse(response), response);
}
///
- /// [Protocol Method] Returns the content of the specified Task file.
+ /// [Protocol Method] Gets information about the specified Task.
///
/// -
///
@@ -4798,51 +4658,38 @@ public virtual Response GetTaskFile(string jobId, string taskId, str
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// The ID of the Job that contains the Task.
- /// The ID of the Task whose file you want to retrieve.
- /// The path to the Task file that you want to get the content of.
+ /// The ID of the Task to get information about.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- ///
- /// The byte range to be retrieved. The default is to retrieve the entire file. The
- /// format is bytes=startRange-endRange.
- ///
+ /// An OData $select clause.
+ /// An OData $expand clause.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task GetTaskFileAsync(string jobId, string taskId, string filePath, int? timeOutInSeconds, DateTimeOffset? ocpdate, string ocpRange, RequestConditions requestConditions, RequestContext context)
+ ///
+ public virtual async Task GetTaskAsync(string jobId, string taskId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, IEnumerable expand, RequestConditions requestConditions, RequestContext context)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
- Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
-
- if (requestConditions?.IfMatch is not null)
- {
- throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-Match header for this operation.");
- }
- if (requestConditions?.IfNoneMatch is not null)
- {
- throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-None-Match header for this operation.");
- }
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTaskFile");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTask");
scope.Start();
try
{
- using HttpMessage message = CreateGetTaskFileRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, ocpRange, requestConditions, context);
+ using HttpMessage message = CreateGetTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -4853,7 +4700,7 @@ public virtual async Task GetTaskFileAsync(string jobId, string taskId
}
///
- /// [Protocol Method] Returns the content of the specified Task file.
+ /// [Protocol Method] Gets information about the specified Task.
///
/// -
///
@@ -4862,51 +4709,38 @@ public virtual async Task GetTaskFileAsync(string jobId, string taskId
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// The ID of the Job that contains the Task.
- /// The ID of the Task whose file you want to retrieve.
- /// The path to the Task file that you want to get the content of.
+ /// The ID of the Task to get information about.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- ///
- /// The byte range to be retrieved. The default is to retrieve the entire file. The
- /// format is bytes=startRange-endRange.
- ///
+ /// An OData $select clause.
+ /// An OData $expand clause.
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response GetTaskFile(string jobId, string taskId, string filePath, int? timeOutInSeconds, DateTimeOffset? ocpdate, string ocpRange, RequestConditions requestConditions, RequestContext context)
+ ///
+ public virtual Response GetTask(string jobId, string taskId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, IEnumerable expand, RequestConditions requestConditions, RequestContext context)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
- Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
-
- if (requestConditions?.IfMatch is not null)
- {
- throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-Match header for this operation.");
- }
- if (requestConditions?.IfNoneMatch is not null)
- {
- throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-None-Match header for this operation.");
- }
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTaskFile");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTask");
scope.Start();
try
{
- using HttpMessage message = CreateGetTaskFileRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, ocpRange, requestConditions, context);
+ using HttpMessage message = CreateGetTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, select, expand, requestConditions, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -4916,20 +4750,78 @@ public virtual Response GetTaskFile(string jobId, string taskId, string filePath
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ /// Updates the properties of the specified Task.
+ /// The ID of the Job containing the Task.
+ /// The ID of the Task to update.
+ /// The Task to update.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ ///
+ public virtual async Task ReplaceTaskAsync(string jobId, string taskId, BatchTask task, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(task, nameof(task));
+
+ using RequestContent content = task.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await ReplaceTaskAsync(jobId, taskId, content, timeOutInSeconds, ocpdate, requestConditions, context).ConfigureAwait(false);
+ return response;
+ }
+
+ /// Updates the properties of the specified Task.
+ /// The ID of the Job containing the Task.
+ /// The ID of the Task to update.
+ /// The Task to update.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ ///
+ public virtual Response ReplaceTask(string jobId, string taskId, BatchTask task, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(task, nameof(task));
+
+ using RequestContent content = task.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = ReplaceTask(jobId, taskId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ return response;
+ }
+
///
- /// [Protocol Method] Gets the properties of the specified Task file.
+ /// [Protocol Method] Updates the properties of the specified Task.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
///
///
- /// The ID of the Job that contains the Task.
- /// The ID of the Task whose file you want to retrieve.
- /// The path to the Task file that you want to get the content of.
+ /// The ID of the Job containing the Task.
+ /// The ID of the Task to update.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -4938,31 +4830,74 @@ public virtual Response GetTaskFile(string jobId, string taskId, string filePath
///
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- internal virtual async Task GetTaskFilePropertiesInternalAsync(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task ReplaceTaskAsync(string jobId, string taskId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
- Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+ Argument.AssertNotNull(content, nameof(content));
- if (requestConditions?.IfMatch is not null)
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceTask");
+ scope.Start();
+ try
{
- throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-Match header for this operation.");
+ using HttpMessage message = CreateReplaceTaskRequest(jobId, taskId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
- if (requestConditions?.IfNoneMatch is not null)
+ catch (Exception e)
{
- throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-None-Match header for this operation.");
+ scope.Failed(e);
+ throw;
}
+ }
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTaskFilePropertiesInternal");
+ ///
+ /// [Protocol Method] Updates the properties of the specified Task.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job containing the Task.
+ /// The ID of the Task to update.
+ /// The content to send as the body of the request.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response ReplaceTask(string jobId, string taskId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceTask");
scope.Start();
try
{
- using HttpMessage message = CreateGetTaskFilePropertiesInternalRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, requestConditions, context);
- return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ using HttpMessage message = CreateReplaceTaskRequest(jobId, taskId, content, timeOutInSeconds, ocpdate, requestConditions, context);
+ return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
{
@@ -4973,7 +4908,7 @@ internal virtual async Task GetTaskFilePropertiesInternalAsync(string
// The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Gets the properties of the specified Task file.
+ /// [Protocol Method] Terminates the specified Task.
///
/// -
///
@@ -4982,9 +4917,8 @@ internal virtual async Task GetTaskFilePropertiesInternalAsync(string
///
///
///
- /// The ID of the Job that contains the Task.
- /// The ID of the Task whose file you want to retrieve.
- /// The path to the Task file that you want to get the content of.
+ /// The ID of the Job containing the Task.
+ /// The ID of the Task to terminate.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -4993,30 +4927,984 @@ internal virtual async Task GetTaskFilePropertiesInternalAsync(string
///
/// The content to send as the request conditions of the request.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- internal virtual Response GetTaskFilePropertiesInternal(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ ///
+ public virtual async Task TerminateTaskAsync(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
- Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
- if (requestConditions?.IfMatch is not null)
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.TerminateTask");
+ scope.Start();
+ try
{
- throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-Match header for this operation.");
+ using HttpMessage message = CreateTerminateTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
- if (requestConditions?.IfNoneMatch is not null)
+ catch (Exception e)
{
- throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-None-Match header for this operation.");
+ scope.Failed(e);
+ throw;
}
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Terminates the specified Task.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job containing the Task.
+ /// The ID of the Task to terminate.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response TerminateTask(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.TerminateTask");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateTerminateTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Reactivates a Task, allowing it to run again even if its retry count has been
+ /// exhausted.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job containing the Task.
+ /// The ID of the Task to reactivate.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task ReactivateTaskAsync(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReactivateTask");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateReactivateTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Reactivates a Task, allowing it to run again even if its retry count has been
+ /// exhausted.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job containing the Task.
+ /// The ID of the Task to reactivate.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response ReactivateTask(string jobId, string taskId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReactivateTask");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateReactivateTaskRequest(jobId, taskId, timeOutInSeconds, ocpdate, requestConditions, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Deletes the specified Task file from the Compute Node where the Task ran.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job that contains the Task.
+ /// The ID of the Task whose file you want to retrieve.
+ /// The path to the Task file that you want to get the content of.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ ///
+ /// Whether to delete children of a directory. If the filePath parameter represents
+ /// a directory instead of a file, you can set recursive to true to delete the
+ /// directory and all of the files and subdirectories in it. If recursive is false
+ /// then the directory must be empty or deletion will fail.
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task DeleteTaskFileAsync(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? recursive = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteTaskFile");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteTaskFileRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, recursive, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Deletes the specified Task file from the Compute Node where the Task ran.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job that contains the Task.
+ /// The ID of the Task whose file you want to retrieve.
+ /// The path to the Task file that you want to get the content of.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ ///
+ /// Whether to delete children of a directory. If the filePath parameter represents
+ /// a directory instead of a file, you can set recursive to true to delete the
+ /// directory and all of the files and subdirectories in it. If recursive is false
+ /// then the directory must be empty or deletion will fail.
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response DeleteTaskFile(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, bool? recursive = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteTaskFile");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteTaskFileRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, recursive, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Returns the content of the specified Task file.
+ /// The ID of the Job that contains the Task.
+ /// The ID of the Task whose file you want to retrieve.
+ /// The path to the Task file that you want to get the content of.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ ///
+ /// The byte range to be retrieved. The default is to retrieve the entire file. The
+ /// format is bytes=startRange-endRange.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ ///
+ public virtual async Task> GetTaskFileAsync(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, string ocpRange = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetTaskFileAsync(jobId, taskId, filePath, timeOutInSeconds, ocpdate, ocpRange, requestConditions, context).ConfigureAwait(false);
+ return Response.FromValue(response.Content, response);
+ }
+
+ /// Returns the content of the specified Task file.
+ /// The ID of the Job that contains the Task.
+ /// The ID of the Task whose file you want to retrieve.
+ /// The path to the Task file that you want to get the content of.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ ///
+ /// The byte range to be retrieved. The default is to retrieve the entire file. The
+ /// format is bytes=startRange-endRange.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ ///
+ public virtual Response GetTaskFile(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, string ocpRange = null, RequestConditions requestConditions = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetTaskFile(jobId, taskId, filePath, timeOutInSeconds, ocpdate, ocpRange, requestConditions, context);
+ return Response.FromValue(response.Content, response);
+ }
+
+ ///
+ /// [Protocol Method] Returns the content of the specified Task file.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job that contains the Task.
+ /// The ID of the Task whose file you want to retrieve.
+ /// The path to the Task file that you want to get the content of.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ ///
+ /// The byte range to be retrieved. The default is to retrieve the entire file. The
+ /// format is bytes=startRange-endRange.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task GetTaskFileAsync(string jobId, string taskId, string filePath, int? timeOutInSeconds, DateTimeOffset? ocpdate, string ocpRange, RequestConditions requestConditions, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+
+ if (requestConditions?.IfMatch is not null)
+ {
+ throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-Match header for this operation.");
+ }
+ if (requestConditions?.IfNoneMatch is not null)
+ {
+ throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-None-Match header for this operation.");
+ }
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTaskFile");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetTaskFileRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, ocpRange, requestConditions, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Returns the content of the specified Task file.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job that contains the Task.
+ /// The ID of the Task whose file you want to retrieve.
+ /// The path to the Task file that you want to get the content of.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ ///
+ /// The byte range to be retrieved. The default is to retrieve the entire file. The
+ /// format is bytes=startRange-endRange.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response GetTaskFile(string jobId, string taskId, string filePath, int? timeOutInSeconds, DateTimeOffset? ocpdate, string ocpRange, RequestConditions requestConditions, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+
+ if (requestConditions?.IfMatch is not null)
+ {
+ throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-Match header for this operation.");
+ }
+ if (requestConditions?.IfNoneMatch is not null)
+ {
+ throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-None-Match header for this operation.");
+ }
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTaskFile");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetTaskFileRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, ocpRange, requestConditions, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Gets the properties of the specified Task file.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job that contains the Task.
+ /// The ID of the Task whose file you want to retrieve.
+ /// The path to the Task file that you want to get the content of.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ internal virtual async Task GetTaskFilePropertiesInternalAsync(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+
+ if (requestConditions?.IfMatch is not null)
+ {
+ throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-Match header for this operation.");
+ }
+ if (requestConditions?.IfNoneMatch is not null)
+ {
+ throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-None-Match header for this operation.");
+ }
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTaskFilePropertiesInternal");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetTaskFilePropertiesInternalRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, requestConditions, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Gets the properties of the specified Task file.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Job that contains the Task.
+ /// The ID of the Task whose file you want to retrieve.
+ /// The path to the Task file that you want to get the content of.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The content to send as the request conditions of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ internal virtual Response GetTaskFilePropertiesInternal(string jobId, string taskId, string filePath, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestConditions requestConditions = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(jobId, nameof(jobId));
+ Argument.AssertNotNullOrEmpty(taskId, nameof(taskId));
+ Argument.AssertNotNullOrEmpty(filePath, nameof(filePath));
+
+ if (requestConditions?.IfMatch is not null)
+ {
+ throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-Match header for this operation.");
+ }
+ if (requestConditions?.IfNoneMatch is not null)
+ {
+ throw new ArgumentNullException(nameof(requestConditions), "Service does not support the If-None-Match header for this operation.");
+ }
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTaskFilePropertiesInternal");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetTaskFilePropertiesInternalRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, requestConditions, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Adds a user Account to the specified Compute Node.
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to create a user Account.
+ /// The options to use for creating the user.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ ///
+ /// You can add a user Account to a Compute Node only when it is in the idle or
+ /// running state.
+ ///
+ ///
+ public virtual async Task CreateNodeUserAsync(string poolId, string nodeId, BatchNodeUserCreateContent user, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNull(user, nameof(user));
+
+ using RequestContent content = user.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await CreateNodeUserAsync(poolId, nodeId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ return response;
+ }
+
+ /// Adds a user Account to the specified Compute Node.
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to create a user Account.
+ /// The options to use for creating the user.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ ///
+ /// You can add a user Account to a Compute Node only when it is in the idle or
+ /// running state.
+ ///
+ ///
+ public virtual Response CreateNodeUser(string poolId, string nodeId, BatchNodeUserCreateContent user, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNull(user, nameof(user));
+
+ using RequestContent content = user.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = CreateNodeUser(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ return response;
+ }
+
+ ///
+ /// [Protocol Method] Adds a user Account to the specified Compute Node.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to create a user Account.
+ /// The content to send as the body of the request.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task CreateNodeUserAsync(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateNodeUser");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateNodeUserRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Adds a user Account to the specified Compute Node.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to create a user Account.
+ /// The content to send as the body of the request.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response CreateNodeUser(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateNodeUser");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateNodeUserRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Deletes a user Account from the specified Compute Node.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to delete a user Account.
+ /// The name of the user Account to delete.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task DeleteNodeUserAsync(string poolId, string nodeId, string userName, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNullOrEmpty(userName, nameof(userName));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteNodeUser");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteNodeUserRequest(poolId, nodeId, userName, timeOutInSeconds, ocpdate, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Deletes a user Account from the specified Compute Node.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to delete a user Account.
+ /// The name of the user Account to delete.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response DeleteNodeUser(string poolId, string nodeId, string userName, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNullOrEmpty(userName, nameof(userName));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteNodeUser");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteNodeUserRequest(poolId, nodeId, userName, timeOutInSeconds, ocpdate, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Updates the password and expiration time of a user Account on the specified Compute Node.
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to update a user Account.
+ /// The name of the user Account to update.
+ /// The options to use for updating the user.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The cancellation token to use.
+ /// , , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ ///
+ /// This operation replaces of all the updatable properties of the Account. For
+ /// example, if the expiryTime element is not specified, the current value is
+ /// replaced with the default value, not left unmodified. You can update a user
+ /// Account on a Compute Node only when it is in the idle or running state.
+ ///
+ ///
+ public virtual async Task ReplaceNodeUserAsync(string poolId, string nodeId, string userName, BatchNodeUserUpdateContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNullOrEmpty(userName, nameof(userName));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using RequestContent content0 = content.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await ReplaceNodeUserAsync(poolId, nodeId, userName, content0, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ return response;
+ }
+
+ /// Updates the password and expiration time of a user Account on the specified Compute Node.
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to update a user Account.
+ /// The name of the user Account to update.
+ /// The options to use for updating the user.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The cancellation token to use.
+ /// , , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ ///
+ /// This operation replaces of all the updatable properties of the Account. For
+ /// example, if the expiryTime element is not specified, the current value is
+ /// replaced with the default value, not left unmodified. You can update a user
+ /// Account on a Compute Node only when it is in the idle or running state.
+ ///
+ ///
+ public virtual Response ReplaceNodeUser(string poolId, string nodeId, string userName, BatchNodeUserUpdateContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNullOrEmpty(userName, nameof(userName));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using RequestContent content0 = content.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = ReplaceNodeUser(poolId, nodeId, userName, content0, timeOutInSeconds, ocpdate, context);
+ return response;
+ }
+
+ ///
+ /// [Protocol Method] Updates the password and expiration time of a user Account on the specified Compute Node.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to update a user Account.
+ /// The name of the user Account to update.
+ /// The content to send as the body of the request.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task ReplaceNodeUserAsync(string poolId, string nodeId, string userName, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNullOrEmpty(userName, nameof(userName));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceNodeUser");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateReplaceNodeUserRequest(poolId, nodeId, userName, content, timeOutInSeconds, ocpdate, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Updates the password and expiration time of a user Account on the specified Compute Node.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the machine on which you want to update a user Account.
+ /// The name of the user Account to update.
+ /// The content to send as the body of the request.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , , or is null.
+ /// , or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response ReplaceNodeUser(string poolId, string nodeId, string userName, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ Argument.AssertNotNullOrEmpty(userName, nameof(userName));
+ Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetTaskFilePropertiesInternal");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceNodeUser");
scope.Start();
try
{
- using HttpMessage message = CreateGetTaskFilePropertiesInternalRequest(jobId, taskId, filePath, timeOutInSeconds, ocpdate, requestConditions, context);
+ using HttpMessage message = CreateReplaceNodeUserRequest(poolId, nodeId, userName, content, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -5026,68 +5914,56 @@ internal virtual Response GetTaskFilePropertiesInternal(string jobId, string tas
}
}
- /// Adds a user Account to the specified Compute Node.
+ /// Gets information about the specified Compute Node.
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to create a user Account.
- /// The options to use for creating the user.
+ /// The ID of the Compute Node that you want to get information about.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// An OData $select clause.
/// The cancellation token to use.
- /// , or is null.
+ /// or is null.
/// or is an empty string, and was expected to be non-empty.
- ///
- /// You can add a user Account to a Compute Node only when it is in the idle or
- /// running state.
- ///
- ///
- public virtual async Task CreateNodeUserAsync(string poolId, string nodeId, BatchNodeUserCreateContent user, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ ///
+ public virtual async Task> GetNodeAsync(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNull(user, nameof(user));
- using RequestContent content = user.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await CreateNodeUserAsync(poolId, nodeId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
- return response;
+ Response response = await GetNodeAsync(poolId, nodeId, timeOutInSeconds, ocpdate, select, context).ConfigureAwait(false);
+ return Response.FromValue(BatchNode.FromResponse(response), response);
}
- /// Adds a user Account to the specified Compute Node.
+ /// Gets information about the specified Compute Node.
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to create a user Account.
- /// The options to use for creating the user.
+ /// The ID of the Compute Node that you want to get information about.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// An OData $select clause.
/// The cancellation token to use.
- /// , or is null.
+ /// or is null.
/// or is an empty string, and was expected to be non-empty.
- ///
- /// You can add a user Account to a Compute Node only when it is in the idle or
- /// running state.
- ///
- ///
- public virtual Response CreateNodeUser(string poolId, string nodeId, BatchNodeUserCreateContent user, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ ///
+ public virtual Response GetNode(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNull(user, nameof(user));
- using RequestContent content = user.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = CreateNodeUser(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
- return response;
+ Response response = GetNode(poolId, nodeId, timeOutInSeconds, ocpdate, select, context);
+ return Response.FromValue(BatchNode.FromResponse(response), response);
}
///
- /// [Protocol Method] Adds a user Account to the specified Compute Node.
+ /// [Protocol Method] Gets information about the specified Compute Node.
///
/// -
///
@@ -5096,37 +5972,36 @@ public virtual Response CreateNodeUser(string poolId, string nodeId, BatchNodeUs
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to create a user Account.
- /// The content to send as the body of the request.
+ /// The ID of the Compute Node that you want to get information about.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// An OData $select clause.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
+ /// or is null.
/// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task CreateNodeUserAsync(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual async Task GetNodeAsync(string poolId, string nodeId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, RequestContext context)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateNodeUser");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetNode");
scope.Start();
try
{
- using HttpMessage message = CreateCreateNodeUserRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ using HttpMessage message = CreateGetNodeRequest(poolId, nodeId, timeOutInSeconds, ocpdate, select, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -5137,7 +6012,7 @@ public virtual async Task CreateNodeUserAsync(string poolId, string no
}
///
- /// [Protocol Method] Adds a user Account to the specified Compute Node.
+ /// [Protocol Method] Gets information about the specified Compute Node.
///
/// -
///
@@ -5146,37 +6021,36 @@ public virtual async Task CreateNodeUserAsync(string poolId, string no
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to create a user Account.
- /// The content to send as the body of the request.
+ /// The ID of the Compute Node that you want to get information about.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
+ /// An OData $select clause.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
+ /// or is null.
/// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response CreateNodeUser(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual Response GetNode(string poolId, string nodeId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, RequestContext context)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.CreateNodeUser");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.GetNode");
scope.Start();
try
{
- using HttpMessage message = CreateCreateNodeUserRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ using HttpMessage message = CreateGetNodeRequest(poolId, nodeId, timeOutInSeconds, ocpdate, select, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -5186,66 +6060,76 @@ public virtual Response CreateNodeUser(string poolId, string nodeId, RequestCont
}
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
- ///
- /// [Protocol Method] Deletes a user Account from the specified Compute Node.
- ///
- /// -
- ///
- /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- ///
- ///
- ///
- ///
+ /// Restarts the specified Compute Node.
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to delete a user Account.
- /// The name of the user Account to delete.
+ /// The ID of the Compute Node that you want to restart.
+ /// The options to use for rebooting the Compute Node.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
- /// Service returned a non-success status code.
- /// The response returned from the service.
- ///
- public virtual async Task DeleteNodeUserAsync(string poolId, string nodeId, string userName, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ /// The cancellation token to use.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// You can restart a Compute Node only if it is in an idle or running state.
+ ///
+ public virtual async Task RebootNodeAsync(string poolId, string nodeId, BatchNodeRebootContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNullOrEmpty(userName, nameof(userName));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteNodeUser");
- scope.Start();
- try
- {
- using HttpMessage message = CreateDeleteNodeUserRequest(poolId, nodeId, userName, timeOutInSeconds, ocpdate, context);
- return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
+ using RequestContent content = parameters?.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await RebootNodeAsync(poolId, nodeId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ return response;
+ }
+
+ /// Restarts the specified Compute Node.
+ /// The ID of the Pool that contains the Compute Node.
+ /// The ID of the Compute Node that you want to restart.
+ /// The options to use for rebooting the Compute Node.
+ /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
+ ///
+ /// The time the request was issued. Client libraries typically set this to the
+ /// current system clock time; set it explicitly if you are calling the REST API
+ /// directly.
+ ///
+ /// The cancellation token to use.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// You can restart a Compute Node only if it is in an idle or running state.
+ ///
+ public virtual Response RebootNode(string poolId, string nodeId, BatchNodeRebootContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
+ Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+
+ using RequestContent content = parameters?.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = RebootNode(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ return response;
}
- // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Deletes a user Account from the specified Compute Node.
+ /// [Protocol Method] Restarts the specified Compute Node.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
///
///
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to delete a user Account.
- /// The name of the user Account to delete.
+ /// The ID of the Compute Node that you want to restart.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -5253,23 +6137,22 @@ public virtual async Task DeleteNodeUserAsync(string poolId, string no
/// directly.
///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response DeleteNodeUser(string poolId, string nodeId, string userName, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual async Task RebootNodeAsync(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNullOrEmpty(userName, nameof(userName));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.DeleteNodeUser");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.RebootNode");
scope.Start();
try
{
- using HttpMessage message = CreateDeleteNodeUserRequest(poolId, nodeId, userName, timeOutInSeconds, ocpdate, context);
- return _pipeline.ProcessMessage(message, context);
+ using HttpMessage message = CreateRebootNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
{
@@ -5278,93 +6161,68 @@ public virtual Response DeleteNodeUser(string poolId, string nodeId, string user
}
}
- /// Updates the password and expiration time of a user Account on the specified Compute Node.
- /// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to update a user Account.
- /// The name of the user Account to update.
- /// The options to use for updating the user.
- /// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
- ///
- /// The time the request was issued. Client libraries typically set this to the
- /// current system clock time; set it explicitly if you are calling the REST API
- /// directly.
- ///
- /// The cancellation token to use.
- /// , , or is null.
- /// , or is an empty string, and was expected to be non-empty.
- ///
- /// This operation replaces of all the updatable properties of the Account. For
- /// example, if the expiryTime element is not specified, the current value is
- /// replaced with the default value, not left unmodified. You can update a user
- /// Account on a Compute Node only when it is in the idle or running state.
- ///
- ///
- public virtual async Task ReplaceNodeUserAsync(string poolId, string nodeId, string userName, BatchNodeUserUpdateContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
- Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNullOrEmpty(userName, nameof(userName));
- Argument.AssertNotNull(content, nameof(content));
-
- using RequestContent content0 = content.ToRequestContent();
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await ReplaceNodeUserAsync(poolId, nodeId, userName, content0, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
- return response;
- }
-
- /// Updates the password and expiration time of a user Account on the specified Compute Node.
+ ///
+ /// [Protocol Method] Restarts the specified Compute Node.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to update a user Account.
- /// The name of the user Account to update.
- /// The options to use for updating the user.
+ /// The ID of the Compute Node that you want to restart.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// The cancellation token to use.
- /// , , or is null.
- /// , or is an empty string, and was expected to be non-empty.
- ///
- /// This operation replaces of all the updatable properties of the Account. For
- /// example, if the expiryTime element is not specified, the current value is
- /// replaced with the default value, not left unmodified. You can update a user
- /// Account on a Compute Node only when it is in the idle or running state.
- ///
- ///
- public virtual Response ReplaceNodeUser(string poolId, string nodeId, string userName, BatchNodeUserUpdateContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response RebootNode(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNullOrEmpty(userName, nameof(userName));
- Argument.AssertNotNull(content, nameof(content));
- using RequestContent content0 = content.ToRequestContent();
- RequestContext context = FromCancellationToken(cancellationToken);
- Response response = ReplaceNodeUser(poolId, nodeId, userName, content0, timeOutInSeconds, ocpdate, context);
- return response;
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.RebootNode");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateRebootNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
}
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Updates the password and expiration time of a user Account on the specified Compute Node.
+ /// [Protocol Method] Starts the specified Compute Node.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
- /// -
- ///
- /// Please try the simpler convenience overload with strongly typed models first.
- ///
- ///
///
///
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to update a user Account.
- /// The name of the user Account to update.
- /// The content to send as the body of the request.
+ /// The ID of the Compute Node that you want to restart.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -5372,23 +6230,21 @@ public virtual Response ReplaceNodeUser(string poolId, string nodeId, string use
/// directly.
///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task ReplaceNodeUserAsync(string poolId, string nodeId, string userName, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual async Task StartNodeAsync(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNullOrEmpty(userName, nameof(userName));
- Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceNodeUser");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.StartNode");
scope.Start();
try
{
- using HttpMessage message = CreateReplaceNodeUserRequest(poolId, nodeId, userName, content, timeOutInSeconds, ocpdate, context);
+ using HttpMessage message = CreateStartNodeRequest(poolId, nodeId, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -5398,25 +6254,19 @@ public virtual async Task ReplaceNodeUserAsync(string poolId, string n
}
}
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
///
- /// [Protocol Method] Updates the password and expiration time of a user Account on the specified Compute Node.
+ /// [Protocol Method] Starts the specified Compute Node.
///
/// -
///
/// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
///
///
- /// -
- ///
- /// Please try the simpler convenience overload with strongly typed models first.
- ///
- ///
///
///
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the machine on which you want to update a user Account.
- /// The name of the user Account to update.
- /// The content to send as the body of the request.
+ /// The ID of the Compute Node that you want to restart.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -5424,23 +6274,21 @@ public virtual async Task ReplaceNodeUserAsync(string poolId, string n
/// directly.
///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
- /// , , or is null.
- /// , or is an empty string, and was expected to be non-empty.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response ReplaceNodeUser(string poolId, string nodeId, string userName, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual Response StartNode(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- Argument.AssertNotNullOrEmpty(userName, nameof(userName));
- Argument.AssertNotNull(content, nameof(content));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.ReplaceNodeUser");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.StartNode");
scope.Start();
try
{
- using HttpMessage message = CreateReplaceNodeUserRequest(poolId, nodeId, userName, content, timeOutInSeconds, ocpdate, context);
+ using HttpMessage message = CreateStartNodeRequest(poolId, nodeId, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -5450,56 +6298,68 @@ public virtual Response ReplaceNodeUser(string poolId, string nodeId, string use
}
}
- /// Gets information about the specified Compute Node.
+ /// Reinstalls the operating system on the specified Compute Node.
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the Compute Node that you want to get information about.
+ /// The ID of the Compute Node that you want to restart.
+ /// The options to use for reimaging the Compute Node.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
/// The cancellation token to use.
/// or is null.
/// or is an empty string, and was expected to be non-empty.
- ///
- public virtual async Task> GetNodeAsync(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, CancellationToken cancellationToken = default)
+ ///
+ /// You can reinstall the operating system on a Compute Node only if it is in an
+ /// idle or running state. This API can be invoked only on Pools created with the
+ /// cloud service configuration property.
+ ///
+ ///
+ public virtual async Task ReimageNodeAsync(string poolId, string nodeId, BatchNodeReimageContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ using RequestContent content = parameters?.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await GetNodeAsync(poolId, nodeId, timeOutInSeconds, ocpdate, select, context).ConfigureAwait(false);
- return Response.FromValue(BatchNode.FromResponse(response), response);
+ Response response = await ReimageNodeAsync(poolId, nodeId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ return response;
}
- /// Gets information about the specified Compute Node.
+ /// Reinstalls the operating system on the specified Compute Node.
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the Compute Node that you want to get information about.
+ /// The ID of the Compute Node that you want to restart.
+ /// The options to use for reimaging the Compute Node.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
/// The cancellation token to use.
/// or is null.
/// or is an empty string, and was expected to be non-empty.
- ///
- public virtual Response GetNode(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, IEnumerable select = null, CancellationToken cancellationToken = default)
+ ///
+ /// You can reinstall the operating system on a Compute Node only if it is in an
+ /// idle or running state. This API can be invoked only on Pools created with the
+ /// cloud service configuration property.
+ ///
+ ///
+ public virtual Response ReimageNode(string poolId, string nodeId, BatchNodeReimageContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
+ using RequestContent content = parameters?.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = GetNode(poolId, nodeId, timeOutInSeconds, ocpdate, select, context);
- return Response.FromValue(BatchNode.FromResponse(response), response);
+ Response response = ReimageNode(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ return response;
}
///
- /// [Protocol Method] Gets information about the specified Compute Node.
+ /// [Protocol Method] Reinstalls the operating system on the specified Compute Node.
///
/// -
///
@@ -5508,36 +6368,36 @@ public virtual Response GetNode(string poolId, string nodeId, int? ti
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the Compute Node that you want to get information about.
+ /// The ID of the Compute Node that you want to restart.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// or is null.
/// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task GetNodeAsync(string poolId, string nodeId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, RequestContext context)
+ ///
+ public virtual async Task ReimageNodeAsync(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetNode");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReimageNode");
scope.Start();
try
{
- using HttpMessage message = CreateGetNodeRequest(poolId, nodeId, timeOutInSeconds, ocpdate, select, context);
+ using HttpMessage message = CreateReimageNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -5548,7 +6408,7 @@ public virtual async Task GetNodeAsync(string poolId, string nodeId, i
}
///
- /// [Protocol Method] Gets information about the specified Compute Node.
+ /// [Protocol Method] Reinstalls the operating system on the specified Compute Node.
///
/// -
///
@@ -5557,36 +6417,36 @@ public virtual async Task GetNodeAsync(string poolId, string nodeId, i
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
///
/// The ID of the Pool that contains the Compute Node.
- /// The ID of the Compute Node that you want to get information about.
+ /// The ID of the Compute Node that you want to restart.
+ /// The content to send as the body of the request.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
/// current system clock time; set it explicitly if you are calling the REST API
/// directly.
///
- /// An OData $select clause.
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// or is null.
/// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response GetNode(string poolId, string nodeId, int? timeOutInSeconds, DateTimeOffset? ocpdate, IEnumerable select, RequestContext context)
+ ///
+ public virtual Response ReimageNode(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.GetNode");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.ReimageNode");
scope.Start();
try
{
- using HttpMessage message = CreateGetNodeRequest(poolId, nodeId, timeOutInSeconds, ocpdate, select, context);
+ using HttpMessage message = CreateReimageNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -5596,10 +6456,10 @@ public virtual Response GetNode(string poolId, string nodeId, int? timeOutInSeco
}
}
- /// Restarts the specified Compute Node.
+ /// Deallocates the specified Compute Node.
/// The ID of the Pool that contains the Compute Node.
/// The ID of the Compute Node that you want to restart.
- /// The options to use for rebooting the Compute Node.
+ /// The options to use for deallocating the Compute Node.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -5609,23 +6469,23 @@ public virtual Response GetNode(string poolId, string nodeId, int? timeOutInSeco
/// The cancellation token to use.
/// or is null.
/// or is an empty string, and was expected to be non-empty.
- /// You can restart a Compute Node only if it is in an idle or running state.
- ///
- public virtual async Task RebootNodeAsync(string poolId, string nodeId, BatchNodeRebootContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ /// You can deallocate a Compute Node only if it is in an idle or running state.
+ ///
+ public virtual async Task DeallocateNodeAsync(string poolId, string nodeId, BatchNodeDeallocateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
using RequestContent content = parameters?.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = await RebootNodeAsync(poolId, nodeId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
+ Response response = await DeallocateNodeAsync(poolId, nodeId, content, timeOutInSeconds, ocpdate, context).ConfigureAwait(false);
return response;
}
- /// Restarts the specified Compute Node.
+ /// Deallocates the specified Compute Node.
/// The ID of the Pool that contains the Compute Node.
/// The ID of the Compute Node that you want to restart.
- /// The options to use for rebooting the Compute Node.
+ /// The options to use for deallocating the Compute Node.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -5635,21 +6495,21 @@ public virtual async Task RebootNodeAsync(string poolId, string nodeId
/// The cancellation token to use.
/// or is null.
/// or is an empty string, and was expected to be non-empty.
- /// You can restart a Compute Node only if it is in an idle or running state.
- ///
- public virtual Response RebootNode(string poolId, string nodeId, BatchNodeRebootContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
+ /// You can deallocate a Compute Node only if it is in an idle or running state.
+ ///
+ public virtual Response DeallocateNode(string poolId, string nodeId, BatchNodeDeallocateContent parameters = null, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
using RequestContent content = parameters?.ToRequestContent();
RequestContext context = FromCancellationToken(cancellationToken);
- Response response = RebootNode(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ Response response = DeallocateNode(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
return response;
}
///
- /// [Protocol Method] Restarts the specified Compute Node.
+ /// [Protocol Method] Deallocates the specified Compute Node.
///
/// -
///
@@ -5658,7 +6518,7 @@ public virtual Response RebootNode(string poolId, string nodeId, BatchNodeReboot
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
@@ -5677,17 +6537,17 @@ public virtual Response RebootNode(string poolId, string nodeId, BatchNodeReboot
/// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual async Task RebootNodeAsync(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual async Task DeallocateNodeAsync(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.RebootNode");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeallocateNode");
scope.Start();
try
{
- using HttpMessage message = CreateRebootNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ using HttpMessage message = CreateDeallocateNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
}
catch (Exception e)
@@ -5698,7 +6558,7 @@ public virtual async Task RebootNodeAsync(string poolId, string nodeId
}
///
- /// [Protocol Method] Restarts the specified Compute Node.
+ /// [Protocol Method] Deallocates the specified Compute Node.
///
/// -
///
@@ -5707,7 +6567,7 @@ public virtual async Task RebootNodeAsync(string poolId, string nodeId
///
/// -
///
- /// Please try the simpler convenience overload with strongly typed models first.
+ /// Please try the simpler convenience overload with strongly typed models first.
///
///
///
@@ -5726,17 +6586,17 @@ public virtual async Task RebootNodeAsync(string poolId, string nodeId
/// or is an empty string, and was expected to be non-empty.
/// Service returned a non-success status code.
/// The response returned from the service.
- ///
- public virtual Response RebootNode(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
+ ///
+ public virtual Response DeallocateNode(string poolId, string nodeId, RequestContent content, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, RequestContext context = null)
{
Argument.AssertNotNullOrEmpty(poolId, nameof(poolId));
Argument.AssertNotNullOrEmpty(nodeId, nameof(nodeId));
- using var scope = ClientDiagnostics.CreateScope("BatchClient.RebootNode");
+ using var scope = ClientDiagnostics.CreateScope("BatchClient.DeallocateNode");
scope.Start();
try
{
- using HttpMessage message = CreateRebootNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
+ using HttpMessage message = CreateDeallocateNodeRequest(poolId, nodeId, content, timeOutInSeconds, ocpdate, context);
return _pipeline.ProcessMessage(message, context);
}
catch (Exception e)
@@ -6003,9 +6863,8 @@ public virtual Response EnableNodeScheduling(string poolId, string nodeId, int?
/// or is null.
/// or is an empty string, and was expected to be non-empty.
///
- /// Before you can remotely login to a Compute Node using the remote login
- /// settings, you must create a user Account on the Compute Node. This API can be
- /// invoked only on Pools created with the virtual machine configuration property.
+ /// Before you can remotely login to a Compute Node using the remote login settings,
+ /// you must create a user Account on the Compute Node.
///
///
public virtual async Task> GetNodeRemoteLoginSettingsAsync(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
@@ -6031,9 +6890,8 @@ public virtual async Task> GetNodeRemoteL
/// or is null.
/// or is an empty string, and was expected to be non-empty.
///
- /// Before you can remotely login to a Compute Node using the remote login
- /// settings, you must create a user Account on the Compute Node. This API can be
- /// invoked only on Pools created with the virtual machine configuration property.
+ /// Before you can remotely login to a Compute Node using the remote login settings,
+ /// you must create a user Account on the Compute Node.
///
///
public virtual Response GetNodeRemoteLoginSettings(string poolId, string nodeId, int? timeOutInSeconds = null, DateTimeOffset? ocpdate = null, CancellationToken cancellationToken = default)
@@ -7036,7 +7894,7 @@ public virtual Pageable GetApplications(int? timeOutInSeconds, DateT
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
///
/// The cancellation token to use.
///
@@ -7082,7 +7940,7 @@ public virtual AsyncPageable GetPoolUsageMetricsAsync(int
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
///
/// The cancellation token to use.
///
@@ -7140,7 +7998,7 @@ public virtual Pageable GetPoolUsageMetrics(int? timeOutI
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// Service returned a non-success status code.
@@ -7191,7 +8049,7 @@ public virtual AsyncPageable GetPoolUsageMetricsAsync(int? timeOutIn
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics.
///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// Service returned a non-success status code.
@@ -7204,7 +8062,7 @@ public virtual Pageable GetPoolUsageMetrics(int? timeOutInSeconds, D
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "BatchClient.GetPoolUsageMetrics", "value", "odata.nextLink", context);
}
- /// Lists all of the Pools in the specified Account.
+ /// Lists all of the Pools which be mounted.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -7217,7 +8075,7 @@ public virtual Pageable GetPoolUsageMetrics(int? timeOutInSeconds, D
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools.
///
/// An OData $select clause.
/// An OData $expand clause.
@@ -7231,7 +8089,7 @@ public virtual AsyncPageable GetPoolsAsync(int? timeOutInSeconds = nu
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BatchPool.DeserializeBatchPool(e), ClientDiagnostics, _pipeline, "BatchClient.GetPools", "value", "odata.nextLink", context);
}
- /// Lists all of the Pools in the specified Account.
+ /// Lists all of the Pools which be mounted.
/// The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".
///
/// The time the request was issued. Client libraries typically set this to the
@@ -7244,7 +8102,7 @@ public virtual AsyncPageable GetPoolsAsync(int? timeOutInSeconds = nu
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools.
///
/// An OData $select clause.
/// An OData $expand clause.
@@ -7259,7 +8117,7 @@ public virtual Pageable GetPools(int? timeOutInSeconds = null, DateTi
}
///
- /// [Protocol Method] Lists all of the Pools in the specified Account.
+ /// [Protocol Method] Lists all of the Pools which be mounted.
///
/// -
///
@@ -7285,7 +8143,7 @@ public virtual Pageable GetPools(int? timeOutInSeconds = null, DateTi
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools.
///
/// An OData $select clause.
/// An OData $expand clause.
@@ -7301,7 +8159,7 @@ public virtual AsyncPageable GetPoolsAsync(int? timeOutInSeconds, Da
}
///
- /// [Protocol Method] Lists all of the Pools in the specified Account.
+ /// [Protocol Method] Lists all of the Pools which be mounted.
///
/// -
///
@@ -7327,7 +8185,7 @@ public virtual AsyncPageable GetPoolsAsync(int? timeOutInSeconds, Da
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-pools.
///
/// An OData $select clause.
/// An OData $expand clause.
@@ -7355,7 +8213,7 @@ public virtual Pageable GetPools(int? timeOutInSeconds, DateTimeOffs
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images.
///
/// The cancellation token to use.
///
@@ -7380,7 +8238,7 @@ public virtual AsyncPageable GetSupportedImagesAsync(int? t
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images.
///
/// The cancellation token to use.
///
@@ -7419,7 +8277,7 @@ public virtual Pageable GetSupportedImages(int? timeOutInSe
///
///
/// An OData $filter clause. For more information on constructing this filter, see
- /// https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images.
+ /// https://learn.microsoft.com/rest/api/batchservice/odata-filters-in-batch#list-support-images.
///
/// The request context, which can override default behaviors of the client pipeline on a per-call basis.
/// Service returned a non-success status code.
@@ -7459,7 +8317,7 @@ public virtual AsyncPageable GetSupportedImagesAsync(int? timeOutInS
///
///