BlobRequestOptions.LocationMode Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece el modo de ubicación de la solicitud.
public Microsoft.Azure.Storage.RetryPolicies.LocationMode? LocationMode { get; set; }
member this.LocationMode : Nullable<Microsoft.Azure.Storage.RetryPolicies.LocationMode> with get, set
Public Property LocationMode As Nullable(Of LocationMode)
Valor de propiedad
Un valor de enumeración LocationMode que indica el modo de ubicación de la solicitud.
Implementaciones
Ejemplos
// The PrimaryOnly LocationMode directs the request and all potential retries to go to the primary endpoint.
BlobRequestOptions locationModeRequestOptions = new BlobRequestOptions() { LocationMode = RetryPolicies.LocationMode.PrimaryOnly };
byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: locationModeRequestOptions);
// The PrimaryThenSecondary LocationMode directs the first request to go to the primary location.
// If this request fails with a retryable error, the retry will next hit the secondary location.
// Retries will switch back and forth between primary and secondary until the request succeeds,
// or retry attempts have been exhausted.
locationModeRequestOptions = new BlobRequestOptions() { LocationMode = RetryPolicies.LocationMode.PrimaryThenSecondary };
byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: locationModeRequestOptions);
// The SecondaryOnly LocationMode directs the request and all potential retries to go to the secondary endpoint.
locationModeRequestOptions = new BlobRequestOptions() { LocationMode = RetryPolicies.LocationMode.SecondaryOnly };
byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: locationModeRequestOptions);
// The SecondaryThenPrimary LocationMode directs the first request to go to the secondary location.
// If this request fails with a retryable error, the retry will next hit the primary location.
// Retries will switch back and forth between secondary and primary until the request succeeds, or retry attempts
// have been exhausted.
locationModeRequestOptions = new BlobRequestOptions() { LocationMode = RetryPolicies.LocationMode.SecondaryThenPrimary };
byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: locationModeRequestOptions);
Comentarios
LocationMode especifica en qué ubicaciones el cliente de almacenamiento intentará realizar la solicitud. Esto solo es válido para las cuentas de RA-GRS: cuentas en las que se pueden leer datos desde el punto de conexión principal o secundario.
Se aplica a
Azure SDK for .NET