List Ranges operation returns the list of valid ranges for a file.
|Enabled file share protocol||Available|
You can construct the
List Ranges request as follows. HTTPS is recommended.
|Method||Request URI||HTTP version|
Replace the path components shown in the request URI with your own, as follows:
||The name of your storage account.|
||The name of your file share.|
||Optional. The path to the parent directory.|
||The name of the file.|
For details on path naming restrictions, see Naming and referencing shares, directories, files, and metadata.
You can specify the following additional parameters on the request URI.
||Optional. Version 2017-04-17 and later. The
||Optional in version 2020-02-10 and later. The
When both this parameter and
Changed pages include both updated and cleared pages.
The following table describes required and optional request headers.
||Required. Specifies the authorization scheme, account name, and signature. For more information, see Authorize requests to Azure Storage.|
||Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authorize requests to Azure Storage.|
||Required for all authorized requests. Specifies the version of the operation to use for this request. For more information, see Versioning for the Azure Storage services.|
||Optional. Specifies the range of bytes over which to list ranges, inclusively. If omitted, then all ranges for the file are returned.|
||Optional. Specifies the range of bytes over which to list ranges, inclusively.
If both the
||Optional. Version 2019-02-02 and later. If the header is specified, the operation will be performed only if the file's lease is currently active, and the lease ID specified in the request matches that of the file. Otherwise, the operation fails with status code 412 (Precondition Failed).|
||Optional. Provides a client-generated, opaque value with a 1-kibibyte (KiB) character limit that's recorded in the logs when logging is configured. We highly recommend that you use this header to correlate client-side activities with requests that the server receives. For more information, see Monitor Azure Files.|
||Optional. Version 2022-11-02 and later. The Boolean value specifies if a trailing dot present in request url should be trimmed or not. For more information, see Naming and referencing shares, directories, files, and metadata.|
The response includes an HTTP status code, a set of response headers, and a response body in XML format.
A successful operation returns status code 200 (OK). For information about status codes, see Status and error codes.
The response for this operation includes the following headers. The response can also include additional, standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
||The date/time that the file was last modified. Any operation that modifies the file, including an update of the file's metadata or properties, changes the file's last modified time.|
||The size of the file in bytes. When
||This header uniquely identifies the request that was made, and can be used for troubleshooting the request. For more information, see Troubleshooting API operations.|
||Indicates the version of Azure Files used to run the request.|
||A UTC date/time value that indicates the time at which the response was initiated. The service generates this value.|
||You can use this header to troubleshoot requests and corresponding responses. The value of this header is equal to the value of the
The response body includes a list of non-overlapping valid ranges, sorted by increasing address range. The format of the response body is as follows.
<?xml version="1.0" encoding="utf-8"?> <Ranges> <Range> <Start>Start Byte</Start> <End>End Byte</End> </Range> <Range> <Start>Start Byte</Start> <End>End Byte</End> </Range> </Ranges>
If the file's entire set of ranges has been cleared, the response body won't include any ranges.
prevsharesnapshot is specified, the response includes only the pages that differ between the target snapshot (or the live file) and the previous snapshot. The ranges returned include both ranges that were updated or that were cleared. The format of this response is as follows:
<?xml version="1.0" encoding="utf-8"?> <Ranges> <Range> <Start>Start Byte</Start> <End>End Byte</Start> </Range> <ClearRange> <Start>Start Byte</Start> <End>End Byte</Start> </ClearRange> <Range> <Start>Start Byte</Start> <End>End Byte</Start> </Range> </Ranges>
If the file's entire set of pages has been cleared, and the
prevsharesnapshot parameter isn't specified, the response body won't include any ranges.
Only the account owner can call this operation.
The start and end byte offsets for each range are inclusive. Refer to the Range Update Operations and Range Clear Operations examples for Put Range. These examples show what ranges are returned if you write or clear a 512-unaligned byte range from the file.
In a highly fragmented file with a large number of writes, a
List Ranges request can fail due to an internal server timeout. Applications retrieving ranges of a file with a large number of write operations should retrieve a subset of ranges at a time.
Beginning with version 2020-02-10, you can call
List Ranges with a
prevsharesnapshot parameter. This returns the ranges that differ between the live file and a snapshot, or between two snapshots of the file on snapshots. By using these range differences, you can retrieve an incremental snapshot of a file. Incremental snapshots are a cost-effective way to back up files if you want to implement your own backup solution.
Certain operations on a file cause
List Ranges to fail when it's called to retrieve an incremental snapshot. The service returns:
- 404 (Not Found) if you call on a file that doesn't exist in one of the snapshots (or live, if
- 409 (Conflict) if you call on a file that was the target of an overwriting Copy after the snapshot, specified by
- 409 (Conflict) if you call on a file that was deleted and re-created with the same name and location, after the snapshot specified by