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. |
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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
the directory information.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
the directory information.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
the directory information includingcreated
boolean member.
already exists.
response
will contain information related to this operation.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; otherwiseresult
will contain
the file information.
response
will contain information related to this operation. -
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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation.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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation.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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation.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; otherwisetext
will contain the file contents,
andfile
will contain the file information.
response
will contain information related to this operation.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; otherwiseresult
will contain
the file information.
response
will contain information related to this operation. -
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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation.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; otherwiseresult
will contain
the share information.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
the share information includingcreated
boolean member.
response
will contain information related to this operation.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; otherwiseresult
will contain
the ID of the snapshot.
response
will contain information related to this operation. -
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 theStream
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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation.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 theStream
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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation.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. -
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; otherwiseresult
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. -
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. -
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; otherwiseresult
will
be true if the file was deleted, or false if the file
does not exist.
response
will contain information related to this operation. -
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. -
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; otherwiseresult
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. -
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; otherwiseresult
will contain
the directory information includingexists
boolean member.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
the file information including theexists
boolean member.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
the share information includingexists
boolean member.
response
will contain information related to this operation. -
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.
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; otherwiseresult
will contain
information about the directory.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information for the directory.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information about the file.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information about the file.
response
will contain information related to this operation. -
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;
otherwiseresult
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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation.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; otherwisetext
will contain the file contents,
andfile
will contain the file information.
response
will contain information related to this operation. -
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
andresponse
will contain information related to this operation. -
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; otherwiseresult
will contain
information for the share.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information for the share.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information for the share.
response
will contain information related to this operation. -
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. -
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.
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; otherwiseresult
will contain
entries.files which contains a list offiles
, entries.directories which contains a list ofdirectories
and the continuationToken for the next listing operation.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
entries.files which contains a list offiles
, entries.directories which contains a list ofdirectories
and the continuationToken for the next listing operation.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
the range information.
response
will contain information related to this operation. -
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; otherwiseresult
will containentries
andcontinuationToken
.
entries
gives a list ofshares
and thecontinuationToken
is used for the next listing operation.
response
will contain information related to this operation. -
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; otherwiseresult
will containentries
andcontinuationToken
.
entries
gives a list ofshares
and thecontinuationToken
is used for the next listing operation.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information about the file.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information on the directory.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information on the file.
response
will contain information related to this operation. -
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; otherwiseresult
will contain
information about the file.
response
will contain information related to this operation. -
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. -
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; otherwiseresult
will contain
information for the share.
response
will contain information related to this operation. -
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. -
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; otherwiseshare
will contain
information about the share.
response
will contain information related to this operation. -
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;
otherwiseresult
will contain the file information.
response
will contain information related to this operation. -
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.