Class: FileService

FileService

The FileService class is used to perform operations on the Microsoft Azure File Service.
The File Service provides storage for binary large objects, and provides functions for working with data stored in files.

For more information on the File Service, as well as task focused information on using it in a Node.js application, see
How to Use the File Service from Node.js.
The following defaults can be set on the file service.
defaultTimeoutIntervalInMs The default timeout interval, in milliseconds, to use for request made via the file service.
defaultEnableReuseSocket The default boolean value to enable socket reuse when uploading local files or streams.
If the Node.js version is lower than 0.10.x, socket reuse will always be turned off.
defaultClientRequestTimeoutInMs The default timeout of client requests, in milliseconds, to use for the request made via the file service.
defaultMaximumExecutionTimeInMs The default maximum execution time across all potential retries, for requests made via the file service.
defaultLocationMode The default location mode for requests made via the file service.
parallelOperationThreadCount The number of parallel operations that may be performed when uploading a file.
useNagleAlgorithm Determines whether the Nagle algorithm is used for requests made via the file service; true to use the
Nagle algorithm; otherwise, false. The default value is false.
enableGlobalHttpAgent Determines whether global HTTP(s) agent is enabled; true to use Global HTTP(s) agent; otherwise, false to use
http(s).Agent({keepAlive:true}).


new FileService( [storageAccountOrConnectionString] [, storageAccessKey] [, host] [, sasToken] [, endpointSuffix])

Creates a new FileService object.
If no connection string or storageaccount and storageaccesskey are provided,
the AZURE_STORAGE_CONNECTION_STRING or AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY environment variables will be used.

Parameters:
Name Type Argument Description
storageAccountOrConnectionString string <optional>

The storage account or the connection string.

storageAccessKey string <optional>

The storage access key.

host string | object <optional>

The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.

sasToken string <optional>

The Shared Access Signature token.

endpointSuffix string <optional>

The endpoint suffix.

Source:

Extends

Members


logger :Logger

The logger of the service. To change the log level of the services, set the logger.level.

Type:
Inherited From:
Source:

Methods


_getUrl()

Get the url of a given path

Inherited From:
Source:

_initializeLocation()

Initializes the location to which the operation is being sent to.

Inherited From:
Source:

_invalidLocationMode()

Checks whether we have the relevant host information based on the locationMode.

Inherited From:
Source:

_maximumExecutionTimeExceeded()

Checks to see if the maximum execution timeout provided has been exceeded.

Inherited From:
Source:

_setDefaultProxy()

Sets the service host default proxy from the environment.
Can be overridden by calling _setProxyUrl or _setProxy

Inherited From:
Source:

_setOperationExpiryTime()

Sets the operation expiry time.

Inherited From:
Source:

_validateLocation()

Validates the location to which the operation is being sent to.

Inherited From:
Source:

abortCopyFile(share, directory, file, copyId [, options], callback)

Abort a file copy operation.

This:
Parameters:
Name Type Argument Description
share string

The destination share name.

directory string

The destination directory name.

file string

The destination file name.

copyId string

The copy operation identifier.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:

clearRange(share, directory, file, rangeStart, rangeEnd [, options], callback)

Clears a range. Clears all of the ranges by default, or only the ranges over a specific range of bytes if rangeStart and rangeEnd are specified.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

rangeStart int

The range start.

rangeEnd int

The range end.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the directory information.
response will contain information related to this operation.

Source:

createDirectory(share, directory [, options], callback)

Creates a new directory under the specified account.
If a directory with the same name already exists, the operation fails.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name.

options object <optional>

The request options.

Properties
Name Type Argument Description
metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the directory information.
response will contain information related to this operation.

Source:

createDirectoryIfNotExists(share, directory [, options], callback)

Creates a new directory under the specified account if the directory does not exists.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name.

options object <optional>

The request options.

Properties
Name Type Argument Description
metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the directory information including created boolean member.
already exists.
response will contain information related to this operation.

Source:
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.createDirectoryIfNotExists('taskshare', taskdirectory', function(error) {
  if(!error) {
    // Directory created or already existed
  }
}); 

createFile(share, directory, file, length [, options], callback)

Creates a file of the specified length. If the file already exists on the service, it will be overwritten.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

length int

The length of the file in bytes.

options object <optional>

The request options.

Properties
Name Type Argument Description
contentSettings object <optional>

The file's content settings.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition.

contentMD5 string <optional>

The file's MD5 hash.

metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the file information.
response will contain information related to this operation.

Source:

createFileFromBrowserFile(share, directory, file, browserFile [, options], callback)

Uploads a file to storage from an HTML File object. If the file already exists on the service, it will be overwritten.
(Only available in the JavaScript Client Library for Browsers)

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

browserFile File

The File object to be uploaded created by HTML File API.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentSettings object <optional>

The file's content settings.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition.

contentMD5 string <optional>

The file's MD5 hash.

metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:
Returns:
Type
SpeedSummary

createFileFromLocalFile(share, directory, file, (string) [, options], callback)

Uploads a file to storage from a local file. If the file already exists on the service, it will be overwritten.
(Not available in the JavaScript Client Library for Browsers)

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

(string)

localFileName The local path to the file to be uploaded.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentSettings object <optional>

The file's content settings.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition.

contentMD5 string <optional>

The file's MD5 hash.

metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:
Returns:
Type
SpeedSummary

createFileFromStream(share, directory, file, (Stream), streamLength [, options], callback)

Uploads a file from a stream. If the file already exists on the service, it will be overwritten.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

(Stream)

stream Stream to the data to store.

streamLength int

The length of the stream to upload.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentSettings object <optional>

The file's content settings.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition.

contentMD5 string <optional>

The file's MD5 hash.

metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:
Returns:
Type
SpeedSummary
Example
var stream = require('stream');
var azure = require('azure-storage');
var fileService = azure.createFileService();

var fileStream = new stream.Readable();
fileStream.push(myFileBuffer);
fileStream.push(null);

fileService.createFileFromStream('taskshare', 'taskdirectory', 'taskfile', fileStream, myFileBuffer.length, function(error, result, response) {
  if (!error) {
    // file uploaded
  }
});

createFileFromText(share, directory, file, text [, options], callback)

Uploads a file from a text string. If the file already exists on the service, it will be overwritten.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

text string | object

The file text, as a string or in a Buffer.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The upload tracker objects;

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentSettings object <optional>

The file's content settings.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition.

contentMD5 string <optional>

The file's MD5 hash.

metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback FileService~FileToText

error will contain information
if an error occurs; otherwise text will contain the file contents,
and file will contain the file information.
response will contain information related to this operation.

Source:
Example
var azure = require('azure-storage');
var fileService = azure.createFileService();

var text = 'Hello World!';

fileService.createFileFromText('taskshare', 'taskdirectory', 'taskfile', text, function(error, result, response) {
  if (!error) {
    // file created
  }
});

createRangesFromStream(share, directory, file, readStream, rangeStart, rangeEnd [, options], callback)

Updates a range from a stream.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

readStream Readable

The Node.js Readable stream.

rangeStart int

The range start.

rangeEnd int

The range end.

options object <optional>

The request options.

Properties
Name Type Argument Description
useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

transactionalContentMD5 string <optional>

An optional hash value used to ensure transactional integrity for the page.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the file information.
response will contain information related to this operation.

Source:

createReadStream(share, directory, file [, options], callback)

Provides a stream to read from a file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

rangeStart string <optional>

Return only the bytes of the file in the specified range.

rangeEnd string <optional>

Return only the bytes of the file in the specified range.

useTransactionalMD5 boolean <optional>

When set to true, Calculate and send/validate content MD5 for transactions.

disableContentMD5Validation boolean <optional>

When set to true, MD5 validation will be disabled when downloading files.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:
Returns:

A Node.js Readable stream.

Type
Readable
Example
var azure = require('azure-storage');
var fileService = azure.createFileService();
var writable = fs.createWriteStream(destinationFileNameTarget);
fileService.createReadStream(shareName, directoryName, fileName).pipe(writable);

createShare(share [, options], callback)

Creates a new share under the specified account.
If a share with the same name already exists, the operation fails.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
quota int <optional>

Specifies the maximum size of the share, in gigabytes.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

metadata object <optional>

The metadata key/value pairs.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the share information.
response will contain information related to this operation.

Source:

createShareIfNotExists(share [, options], callback)

Creates a new share under the specified account if the share does not exists.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

metadata object <optional>

The metadata key/value pairs.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the share information including created boolean member.
response will contain information related to this operation.

Source:
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.createShareIfNotExists('taskshare', function(error) {
  if(!error) {
    // Share created or already existed
  }
}); 

createShareSnapshot(share [, options], callback)

Creates a share snapshot.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

metadata object <optional>

The metadata key/value pairs.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the ID of the snapshot.
response will contain information related to this operation.

Source:

createWriteStreamToExistingFile(share, directory, file [, options], callback)

Provides a stream to write to a file. Assumes that the file exists.
If it does not, please create the file using createFile before calling this method or use createWriteStreamNewFile.
Please note the Stream returned by this API should be used with piping.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentSettings object <optional>

The file's content settings.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition.

contentMD5 string <optional>

The file's MD5 hash.

metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:
Returns:

A Node.js Writable stream.

Type
Writable
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.createFile(shareName, directoryName, fileName, 1024, function (err) {
  // Pipe file to a file
  var stream = fs.createReadStream(fileNameTarget).pipe(FileService.createWriteStreamToExistingFile(shareName, directoryName, fileName));
});

createWriteStreamToNewFile(share, directory, file, length [, options], callback)

Provides a stream to write to a file. Creates the file before writing data.
Please note the Stream returned by this API should be used with piping.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

length string

The file length.

options object <optional>

The request options.

Properties
Name Type Argument Description
speedSummary SpeedSummary <optional>

The download tracker objects;

storeFileContentMD5 bool <optional>

Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.

useTransactionalMD5 bool <optional>

Calculate and send/validate content MD5 for transactions.

contentSettings object <optional>

The file's content settings.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

cacheControl string <optional>

The file service stores this value but does not use or modify it.

contentDisposition string <optional>

The file's content disposition.

contentMD5 string <optional>

The file's MD5 hash.

metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:
Returns:

A Node.js Writable stream.

Type
Writable
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
var stream = fs.createReadStream(fileNameTarget).pipe(FileService.createWriteStreamToNewFile(shareName, directoryName, fileName));

deleteDirectory(share, directory [, options], callback)

Marks the specified directory for deletion. The directory must be empty before it can be deleted.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResponse

error will contain information
if an error occurs; otherwise
response will contain information related to this operation.

Source:

deleteDirectoryIfExists(share, directory [, options], callback)

Marks the specified directory for deletion if it exists. The directory must be empty before it can be deleted.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will
be true if the directory exists and was deleted, or false if the directory
did not exist.
response will contain information related to this operation.

Source:

deleteFile(share, directory, file [, options], callback)

Marks the specified file for deletion. The file is later deleted during garbage collection.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResponse

error will contain information
if an error occurs; response will contain information related to this operation.

Source:

deleteFileIfExists(share, directory, file [, options], callback)

Marks the specified file for deletion if it exists. The file is later deleted during garbage collection.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will
be true if the file was deleted, or false if the file
does not exist.
response will contain information related to this operation.

Source:

deleteShare(share [, options], callback)

Marks the specified share for deletion.
The share and any files contained within it are later deleted during garbage collection.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
deleteSnapshots string <optional>

The snapshot delete option. See azure.FileUtilities.ShareSnapshotDeleteOptions.*.

shareSnapshotId string <optional>

The share snapshot identifier.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResponse

error will contain information
if an error occurs; otherwise
response will contain information related to this operation.

Source:

deleteShareIfExists(share [, options], callback)

Marks the specified share for deletion if it exists.
The share and any files contained within it are later deleted during garbage collection.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
deleteSnapshots string <optional>

The snapshot delete option. See azure.FileUtilities.ShareSnapshotDeleteOptions.*.

shareSnapshotId string <optional>

The share snapshot identifier.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will
be true if the share exists and was deleted, or false if the share
did not exist.
response will contain information related to this operation.

Source:

doesDirectoryExist(share, directory [, options], callback)

Checks whether or not a directory exists on the service.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The share snapshot identifier.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the directory information including exists boolean member.
response will contain information related to this operation.

Source:

doesFileExist(share, directory, file [, options], callback)

Checks whether or not a file exists on the service.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback function

error will contain information
if an error occurs; otherwise result will contain
the file information including the exists boolean member.
response will contain information related to this operation.

Source:

doesShareExist(share [, options], callback)

Checks whether or not a share exists on the service.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the share information including exists boolean member.
response will contain information related to this operation.

Source:

generateSharedAccessSignature(share [, directory] [, file], sharedAccessPolicy [, headers])

Retrieves a shared access signature token.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string <optional>

The directory name. Use '' to refer to the base directory.

file string <optional>

The file name.

sharedAccessPolicy object

The shared access policy.

Properties
Name Type Argument Description
Id string <optional>

The signed identifier.

AccessPolicy.Permissions object <optional>

The permission type.

AccessPolicy.Start date | string <optional>

The time at which the Shared Access Signature becomes valid (The UTC value will be used).

AccessPolicy.Expiry date | string <optional>

The time at which the Shared Access Signature becomes expired (The UTC value will be used).

AccessPolicy.IPAddressOrRange string <optional>

An IP address or a range of IP addresses from which to accept requests. When specifying a range, note that the range is inclusive.

AccessPolicy.Protocols string <optional>

The protocols permitted for a request made with the account SAS.
Possible values are both HTTPS and HTTP (https,http) or HTTPS only (https). The default value is https,http.

headers object <optional>

The optional header values to set for a file returned wth this SAS.

Properties
Name Type Argument Description
cacheControl string <optional>

The optional value of the Cache-Control response header to be returned when this SAS is used.

contentType string <optional>

The optional value of the Content-Type response header to be returned when this SAS is used.

contentEncoding string <optional>

The optional value of the Content-Encoding response header to be returned when this SAS is used.

contentLanguage string <optional>

The optional value of the Content-Language response header to be returned when this SAS is used.

contentDisposition string <optional>

The optional value of the Content-Disposition response header to be returned when this SAS is used.

Source:
Returns:

The shared access signature query string. Note this string does not contain the leading "?".

Type
string

getDirectoryMetadata(share, directory [, options], callback)

Returns all user-defined metadata for the specified directory.
Note that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information about the directory.
response will contain information related to this operation.

Source:

getDirectoryProperties(share, directory [, options], callback)

Retrieves a directory and its properties from a specified account.
Note that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information for the directory.
response will contain information related to this operation.

Source:

getFileMetadata(share, directory, file [, options], callback)

Returns all user-defined metadata for the specified file.
It does not modify or return the content of the file.
Note that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information about the file.
response will contain information related to this operation.

Source:

getFileProperties(share, directory, file [, options], callback)

Returns all user-defined metadata, standard HTTP properties, and system properties for the file.
It does not return or modify the content of the file.
Note that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information about the file.
response will contain information related to this operation.

Source:

getFileToLocalFile(share, directory, file, localFileName [, options], callback)

Downloads an Azure file into a file.
(Not available in the JavaScript Client Library for Browsers)

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

localFileName string

The local path to the file to be downloaded.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

skipSizeCheck boolean <optional>

Skip the size check to perform direct download.
Set the option to true for small files.
Parallel download and speed summary won't work with this option on.

speedSummary SpeedSummary <optional>

The download tracker objects.

parallelOperationThreadCount int <optional>

The number of parallel operations that may be performed when uploading.

rangeStart string <optional>

Return only the bytes of the file in the specified range.

rangeEnd string <optional>

Return only the bytes of the file in the specified range.

useTransactionalMD5 boolean <optional>

When set to true, Calculate and send/validate content MD5 for transactions.

disableContentMD5Validation boolean <optional>

When set to true, MD5 validation will be disabled when downloading files.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:
Returns:
Type
SpeedSummary
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.getFileToLocalFile('taskshare', taskdirectory', 'task1', 'task1-download.txt', function(error, serverFile) {
  if(!error) {
    // file available in serverFile.file variable
  }

getFileToStream(share, directory, file, writeStream [, options], callback)

Downloads a file into a stream.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

writeStream Writable

The Node.js Writable stream.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

skipSizeCheck boolean <optional>

Skip the size check to perform direct download.
Set the option to true for small files.
Parallel download and speed summary won't work with this option on.

speedSummary SpeedSummary <optional>

The download tracker objects.

parallelOperationThreadCount int <optional>

The number of parallel operations that may be performed when uploading.

rangeStart string <optional>

Return only the bytes of the file in the specified range.

rangeEnd string <optional>

Return only the bytes of the file in the specified range.

useTransactionalMD5 boolean <optional>

When set to true, Calculate and send/validate content MD5 for transactions.

disableContentMD5Validation boolean <optional>

When set to true, MD5 validation will be disabled when downloading files.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:
Returns:
Type
SpeedSummary
Example
var azure = require('azure-storage');
var FileService = azure.createFileService();
FileService.getFileToStream('taskshare', taskdirectory', 'task1', fs.createWriteStream('task1-download.txt'), function(error, serverFile) {
  if(!error) {
    // file available in serverFile.file variable
  }
}); 

getFileToText(share, directory, file [, options], callback)

Downloads a file into a text string.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

rangeStart int <optional>

The range start.

rangeEnd int <optional>

The range end.

disableContentMD5Validation boolean <optional>

When set to true, MD5 validation will be disabled when downloading files.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback FileService~FileToText

error will contain information
if an error occurs; otherwise text will contain the file contents,
and file will contain the file information.
response will contain information related to this operation.

Source:

getServiceProperties( [options], callback)

Gets the properties of a storage account's File service, including Azure Storage Analytics.

This:
Parameters:
Name Type Argument Description
options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise, result will contain the properties
and response will contain information related to this operation.

Source:

getShareAcl(share [, options], callback)

Gets the share's ACL.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information for the share.
response will contain information related to this operation.

Source:

getShareMetadata(share [, options], callback)

Returns all user-defined metadata for the share.
Note that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information for the share.
response will contain information related to this operation.

Source:

getShareProperties(share [, options], callback)

Retrieves a share and its properties from a specified account.
Note that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information for the share.
response will contain information related to this operation.

Source:

getShareStats(share [, options], callback)

Gets the share statistics for a share.

This:
Parameters:
Name Type Argument Description
share string

The share name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs; otherwise, result will contain the stats and
response will contain information related to this operation.

Source:

getUrl(share, directory [, file] [, sasToken] [, primary] [, shareSnapshotId])

Retrieves a file or directory URL.

Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string <optional>

The file name. File names may not start or end with the delimiter '/'.

sasToken string <optional>

The Shared Access Signature token.

primary boolean <optional>

A boolean representing whether to use the primary or the secondary endpoint.

shareSnapshotId string <optional>

The snapshot identifier of the share.

Source:
Returns:

The formatted URL string.

Type
string
Example
var azure = require('azure-storage');
var fileService = azure.createFileService();
var sharedAccessPolicy = {
  AccessPolicy: {
    Permissions: azure.FileUtilities.SharedAccessPermissions.READ,
    Start: startDate,
    Expiry: expiryDate
  },
};

var sasToken = fileService.generateSharedAccessSignature(shareName, directoryName, fileName, sharedAccessPolicy);
var url = fileService.getUrl(shareName, directoryName, fileName, sasToken, true);

listFilesAndDirectoriesSegmented(share, directory, currentToken [, options], callback)

Lists a segment containing a collection of file items in the directory.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

currentToken object

A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

maxResults int <optional>

Specifies the maximum number of files to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
entries.files which contains a list of files, entries.directories which contains a list of directories and the continuationToken for the next listing operation.
response will contain information related to this operation.

Source:

listFilesAndDirectoriesSegmentedWithPrefix(share, directory, prefix, currentToken [, options], callback)

Lists a segment containing a collection of file items in the directory.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

prefix string

The prefix of the directory/files name.

currentToken object

A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

maxResults int <optional>

Specifies the maximum number of files to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
entries.files which contains a list of files, entries.directories which contains a list of directories and the continuationToken for the next listing operation.
response will contain information related to this operation.

Source:

listRanges(share, directory, file [, options], callback)

Lists file ranges. Lists all of the ranges by default, or only the ranges over a specific range of bytes if rangeStart and rangeEnd are specified.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

options object <optional>

The request options.

Properties
Name Type Argument Description
shareSnapshotId string <optional>

The snapshot identifier of the share.

rangeStart int <optional>

The range start.

rangeEnd int <optional>

The range end.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
the range information.
response will contain information related to this operation.

Source:

listSharesSegmented(currentToken [, options], callback)

Lists a segment containing a collection of share items under the specified account.

This:
Parameters:
Name Type Argument Description
currentToken object

A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

maxResults int <optional>

Specifies the maximum number of shares to return per call to Azure storage.

include string <optional>

Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata', 'snapshots' or any combination of them)
Note that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain entries and continuationToken.
entries gives a list of shares and the continuationToken is used for the next listing operation.
response will contain information related to this operation.

Source:

listSharesSegmentedWithPrefix(prefix, currentToken [, options], callback)

Lists a segment containing a collection of share items whose names begin with the specified prefix under the specified account.

This:
Parameters:
Name Type Argument Description
prefix string

The prefix of the share name.

currentToken object

A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

prefix string <optional>

Filters the results to return only shares whose name begins with the specified prefix.

maxResults int <optional>

Specifies the maximum number of shares to return per call to Azure storage.

include string <optional>

Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata', 'snapshots' or any combination of them)
Note that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain entries and continuationToken.
entries gives a list of shares and the continuationToken is used for the next listing operation.
response will contain information related to this operation.

Source:

resizeFile(share, directory, file, size [, options], callback)

Resizes a file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

size String

The size of the file, in bytes.

options object <optional>

The request options.

Properties
Name Type Argument Description
timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information about the file.
response will contain information related to this operation.

Source:

setAccountServiceProperties(serviceProperties [, options], callback)

Sets the properties of a storage account’s service, including Azure Storage Analytics.
You can also use this operation to set the default request version for all incoming requests that do not have a version specified.

This:
Parameters:
Name Type Argument Description
serviceProperties object

The service properties.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResponse

error will contain information
if an error occurs; otherwise, response
will contain information related to this operation.

Inherited From:
Source:

setDirectoryMetadata(share, directory, metadata [, options], callback)

Sets user-defined metadata for the specified directory as one or more name-value pairs

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

metadata object

The metadata key/value pairs.

options object <optional>

The request options.

Properties
Name Type Argument Description
timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information on the directory.
response will contain information related to this operation.

Source:

setFileMetadata(share, directory, file, metadata [, options], callback)

Sets user-defined metadata for the specified file as one or more name-value pairs
It does not modify or return the content of the file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

metadata object

The metadata key/value pairs.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information on the file.
response will contain information related to this operation.

Source:

setFileProperties(share, directory, file [, properties] [, options], callback)

Sets user-defined properties for the specified file.
It does not modify or return the content of the file.

This:
Parameters:
Name Type Argument Description
share string

The share name.

directory string

The directory name. Use '' to refer to the base directory.

file string

The file name. File names may not start or end with the delimiter '/'.

properties object <optional>

The file properties to set.

Properties
Name Type Argument Description
contentType string <optional>

The MIME content type of the file. The default type is application/octet-stream.

contentEncoding string <optional>

The content encodings that have been applied to the file.

contentLanguage string <optional>

The natural languages used by this resource.

cacheControl string <optional>

The file's cache control.

contentDisposition string <optional>

The file's content disposition.

contentLength string <optional>

Resizes a file to the specified size. If the specified byte value is less than the current size of the file,
then all ranges above the specified byte value are cleared.

contentMD5 string <optional>

The file's MD5 hash.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information about the file.
response will contain information related to this operation.

Source:

setProxy(proxy)

Sets proxy object specified by caller.

Parameters:
Name Type Description
proxy object

proxy to use for tunneling
{
host: hostname
port: port number
proxyAuth: 'user:password' for basic auth
headers: {...} headers for proxy server
key: key for proxy server
ca: ca for proxy server
cert: cert for proxy server
}
if null or undefined, clears proxy

Inherited From:
Source:

setServiceProperties(serviceProperties [, options], callback)

Sets the properties of a storage account's File service, including Azure Storage Analytics.
You can also use this operation to set the default request version for all incoming requests that do not have a version specified.

This:
Parameters:
Name Type Argument Description
serviceProperties object

The service properties.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResponse

error will contain information
if an error occurs; otherwise, response
will contain information related to this operation.

Source:

setShareAcl(share, signedIdentifiers [, options], callback)

Updates the share's ACL.

This:
Parameters:
Name Type Argument Description
share string

The share name.

signedIdentifiers Object.<string, AccessPolicy>

The share ACL settings. See AccessPolicy for detailed information.

options object <optional>

The request options.

Properties
Name Type Argument Description
timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
information for the share.
response will contain information related to this operation.

Source:

setShareMetadata(share, metadata [, options], callback)

Sets the share's metadata.

Calling the Set Share Metadata operation overwrites all existing metadata that is associated with the share.
It's not possible to modify an individual name/value pair.

This:
Parameters:
Name Type Argument Description
share string

The share name.

metadata object

The metadata key/value pairs.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResponse

error will contain information
if an error occurs; otherwise
response will contain information related to this operation.

Source:

setShareProperties(share [, properties] [, options], callback)

Sets the properties for the specified share.

This:
Parameters:
Name Type Argument Description
share string

The share name.

properties object <optional>

The share properties to set.

Properties
Name Type Argument Description
quota string | int <optional>

Specifies the maximum size of the share, in gigabytes.

options object <optional>

The request options.

Properties
Name Type Argument Description
timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information
if an error occurs; otherwise share will contain
information about the share.
response will contain information related to this operation.

Source:

startCopyFile(sourceUri, targetShare, targetDirectory, targetFile [, options], callback)

Starts to copy a file to a destination within the storage account.

This:
Parameters:
Name Type Argument Description
sourceUri string

The source file or blob URI.

targetShare string

The target share name.

targetDirectory string

The target directory name.

targetFile string

The target file name.

options object <optional>

The request options.

Properties
Name Type Argument Description
metadata object <optional>

The target file metadata key/value pairs.

accessConditions AccessConditions <optional>

The access conditions.

sourceAccessConditions AccessConditions <optional>

The source access conditions.

locationMode LocationMode <optional>

Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.

timeoutIntervalInMs int <optional>

The server timeout interval, in milliseconds, to use for the request.

clientRequestTimeoutInMs int <optional>

The timeout of client requests, in milliseconds, to use for the request.

maximumExecutionTimeInMs int <optional>

The maximum execution time, in milliseconds, across all potential retries, to use when making this request.
The maximum execution time interval begins at the time that the client begins building the request. The maximum
execution time is checked intermittently while performing requests, and before executing retries.

clientRequestId string <optional>

A string that represents the client request ID with a 1KB character limit.

useNagleAlgorithm bool <optional>

Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.

callback errorOrResult

error will contain information if an error occurs;
otherwise result will contain the file information.
response will contain information related to this operation.

Source:

withFilter(filter)

Associate a filtering operation with this StorageServiceClient. Filtering operations
can include logging, automatically retrying, etc. Filter operations are objects
that implement a method with the signature:

"function handle (requestOptions, next)".

After doing its preprocessing on the request options, the method needs to call
"next" passing a callback with the following signature:
signature:

"function (returnObject, finalCallback, next)"

In this callback, and after processing the returnObject (the response from the
request to the server), the callback needs to either invoke next if it exists to
continue processing other filters or simply invoke finalCallback otherwise to end
up the service invocation.

Parameters:
Name Type Description
filter Object

The new filter object.

Inherited From:
Source:
Returns:

A new service client with the filter applied.

Type
StorageServiceClient

Type Definitions


FileToText(error, text, file, response)

The callback for {FileService~getFileToText}.

Parameters:
Name Type Description
error object

If an error occurs, the error information.

text string

The text returned from the file.

file object

Information about the file.

response object

Information related to this operation.

Source: