Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
aa8d775
RecoveryServices: ILR mount scripts via dedicated listMountScripts ac…
hiaga Sep 3, 2026
0af1fa9
RecoveryServices: repoint Backup SDK swagger to merged Azure spec (PR…
hiaga Sep 3, 2026
0fc213b
Merge origin/main: promote RecoveryServices Backup SDK to api-version…
hiaga Sep 10, 2026
2977661
Test: document ILR mount-script scenario coverage for dedicated list …
hiaga Sep 14, 2026
675e5f8
[Az.RecoveryServices] Re-record ILR mount-script test + fix backup re…
hiaga Sep 16, 2026
6f31809
Merge remote-tracking branch 'origin/main' into ilr-merge
hiaga Sep 21, 2026
9a7bf7b
Apply reviewer fixes: fail-fast on failed ILR provision LRO (#10) and…
hiaga Sep 21, 2026
475eebf
Revert unrelated SourceScan recordings to main pending 2026-08-01 re-…
hiaga Sep 21, 2026
dd55b5c
Test: re-record TestAzureVMSourceScan at api-version 2026-08-01
hiaga Sep 22, 2026
ffc9219
Test: do not emit ILR mount CHAP password to test output
hiaga Sep 22, 2026
0eba61c
Fix: treat any non-Succeeded terminal provision status as ILR failure
hiaga Sep 22, 2026
8afe3cc
Merge origin/main into ILR PowerShell branch
hiaga Sep 24, 2026
9af69df
Address ILR mount-script review comments
hiaga Sep 24, 2026
8b67235
Re-record vault immutability scenario
hiaga Sep 24, 2026
3d2879c
Fix ILR mount-script client-script selection regression + SourceScan …
hiaga Sep 26, 2026
d92a9dc
Re-record AFS cross-subscription restore lookup
hiaga Sep 26, 2026
e4d614f
Skip AFS cross-region cross-subscription restore test pending CRR setup
hiaga Sep 27, 2026
cd4eae7
Re-record AFS managed-identity backup tests for backup dataplane api-…
hiaga Sep 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,54 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup
/// </summary>
public partial interface IItemLevelRecoveryConnectionsOperations
{
/// <summary>
/// Fetches the mount scripts (iSCSI connection details) for an active Instant
/// Item Recovery (ILR) session on the recovery point. Required from API
/// version 2026-08-01 onwards; replaces the scripts previously returned inline
/// in the operationsStatus (ILR provision) response.
/// </summary>
/// <remarks>
/// Fetches the mount scripts (iSCSI connection details) for an active Instant
/// Item Recovery (ILR) session on the recovery point. Required from API
/// version 2026-08-01 onwards; replaces the scripts previously returned inline
/// in the operationsStatus (ILR provision) response.
/// </remarks>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='vaultName'>
/// The name of the VaultResource
/// </param>
/// <param name='fabricName'>
/// The name of the BackupFabricResource
/// </param>
/// <param name='containerName'>
/// Name of the container whose details need to be fetched.
/// </param>
/// <param name='protectedItemName'>
/// Backed up item name whose details are to be fetched.
/// </param>
/// <param name='recoveryPointId'>
/// RecoveryPointID represents the backed up data to be fetched.
/// </param>
/// <param name='provisionInstantItemRecoveryOperationId'>
/// Operation ID returned by the prior provisionInstantItemRecovery action
/// whose iSCSI mount scripts are to be retrieved.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<InstantItemRecoveryTarget>> ListInstantItemRecoveryOperationResultWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, string provisionInstantItemRecoveryOperationId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

/// <summary>
/// Provisions a script which invokes an iSCSI connection to the backup data.
/// Executing this script opens a file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,289 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl
/// </summary>
public RecoveryServicesBackupClient Client { get; private set; }

/// <summary>
/// Fetches the mount scripts (iSCSI connection details) for an active Instant
/// Item Recovery (ILR) session on the recovery point. Required from API
/// version 2026-08-01 onwards; replaces the scripts previously returned inline
/// in the operationsStatus (ILR provision) response.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='vaultName'>
/// The name of the VaultResource
/// </param>
/// <param name='fabricName'>
/// The name of the BackupFabricResource
/// </param>
/// <param name='containerName'>
/// Name of the container whose details need to be fetched.
/// </param>
/// <param name='protectedItemName'>
/// Backed up item name whose details are to be fetched.
/// </param>
/// <param name='recoveryPointId'>
/// RecoveryPointID represents the backed up data to be fetched.
/// </param>
/// <param name='provisionInstantItemRecoveryOperationId'>
/// Operation ID returned by the prior provisionInstantItemRecovery action
/// whose iSCSI mount scripts are to be retrieved.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
/// <exception cref="System.ArgumentNullException">
/// Thrown when a required parameter is null
/// </exception>
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<InstantItemRecoveryTarget>> ListInstantItemRecoveryOperationResultWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, string provisionInstantItemRecoveryOperationId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{




if (this.Client.ApiVersion == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}

if (this.Client.SubscriptionId == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
if (this.Client.SubscriptionId != null)
{
if (this.Client.SubscriptionId.Length < 1)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1);
}
}
if (resourceGroupName == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName");
}
if (resourceGroupName != null)
{
if (resourceGroupName.Length > 90)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90);
}
if (resourceGroupName.Length < 1)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1);
}
}
if (vaultName == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName");
}

if (fabricName == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "fabricName");
}

if (containerName == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName");
}

if (protectedItemName == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "protectedItemName");
}

if (recoveryPointId == null)
{
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "recoveryPointId");
}

InstantItemRecoveryOperationResultRequest body = new InstantItemRecoveryOperationResultRequest();
if(provisionInstantItemRecoveryOperationId != null)
{
body.ProvisionInstantItemRecoveryOperationId = provisionInstantItemRecoveryOperationId;
}
// Tracing
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("vaultName", vaultName);
tracingParameters.Add("fabricName", fabricName);
tracingParameters.Add("containerName", containerName);
tracingParameters.Add("protectedItemName", protectedItemName);
tracingParameters.Add("recoveryPointId", recoveryPointId);

tracingParameters.Add("body", body);

tracingParameters.Add("cancellationToken", cancellationToken);
Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListInstantItemRecoveryOperationResult", tracingParameters);
}
// Construct URL

var _baseUrl = this.Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/listInstantItemRecoveryOperationResult").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName));
_url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName));
_url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName));
_url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName));
_url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId));

System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>();
if (this.Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new System.Net.Http.HttpRequestMessage();
System.Net.Http.HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new System.Net.Http.HttpMethod("POST");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
{
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
}
if (this.Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
_httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
}

if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
if(body != null)
{
_requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings);
_httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
// Set Credentials
if (this.Client.Credentials != null)
{
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
_httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
}

System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;

if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<ErrorResponse>(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
}
}
catch (Newtonsoft.Json.JsonException)
{
// Ignore the exception
}
ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new Microsoft.Rest.Azure.AzureOperationResponse<InstantItemRecoveryTarget>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;

if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<InstantItemRecoveryTarget>(_responseContent, this.Client.DeserializationSettings);
}
catch (Newtonsoft.Json.JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
}
return _result;





}
/// <summary>
/// Provisions a script which invokes an iSCSI connection to the backup data.
/// Executing this script opens a file
Expand Down
Loading