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 sharestring The destination share name.
directorystring The destination directory name.
filestring The destination file name.
copyIdstring The copy operation identifier.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
rangeStartint The range start.
rangeEndint The range end.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the directory information.
responsewill 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 sharestring The share name.
directorystring The directory name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the directory information.
responsewill 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 sharestring The share name.
directorystring The directory name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the directory information includingcreatedboolean member.
already exists.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
lengthint The length of the file in bytes.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description contentSettingsobject <optional>
The file's content settings.
Properties
Name Type Argument Description contentTypestring <optional>
The MIME content type of the file. The default type is application/octet-stream.
contentEncodingstring <optional>
The content encodings that have been applied to the file.
contentLanguagestring <optional>
The natural languages used by this resource.
cacheControlstring <optional>
The file service stores this value but does not use or modify it.
contentDispositionstring <optional>
The file's content disposition.
contentMD5string <optional>
The file's MD5 hash.
metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
browserFileFile The File object to be uploaded created by HTML File API.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description speedSummarySpeedSummary <optional>
The download tracker objects;
storeFileContentMD5bool <optional>
Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.useTransactionalMD5bool <optional>
Calculate and send/validate content MD5 for transactions.
contentSettingsobject <optional>
The file's content settings.
Properties
Name Type Argument Description contentTypestring <optional>
The MIME content type of the file. The default type is application/octet-stream.
contentEncodingstring <optional>
The content encodings that have been applied to the file.
contentLanguagestring <optional>
The natural languages used by this resource.
cacheControlstring <optional>
The file service stores this value but does not use or modify it.
contentDispositionstring <optional>
The file's content disposition.
contentMD5string <optional>
The file's MD5 hash.
metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
(string)localFileName The local path to the file to be uploaded.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description speedSummarySpeedSummary <optional>
The download tracker objects;
storeFileContentMD5bool <optional>
Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.useTransactionalMD5bool <optional>
Calculate and send/validate content MD5 for transactions.
contentSettingsobject <optional>
The file's content settings.
Properties
Name Type Argument Description contentTypestring <optional>
The MIME content type of the file. The default type is application/octet-stream.
contentEncodingstring <optional>
The content encodings that have been applied to the file.
contentLanguagestring <optional>
The natural languages used by this resource.
cacheControlstring <optional>
The file service stores this value but does not use or modify it.
contentDispositionstring <optional>
The file's content disposition.
contentMD5string <optional>
The file's MD5 hash.
metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
(Stream)stream Stream to the data to store.
streamLengthint The length of the stream to upload.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description speedSummarySpeedSummary <optional>
The download tracker objects;
storeFileContentMD5bool <optional>
Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.useTransactionalMD5bool <optional>
Calculate and send/validate content MD5 for transactions.
contentSettingsobject <optional>
The file's content settings.
Properties
Name Type Argument Description contentTypestring <optional>
The MIME content type of the file. The default type is application/octet-stream.
contentEncodingstring <optional>
The content encodings that have been applied to the file.
contentLanguagestring <optional>
The natural languages used by this resource.
cacheControlstring <optional>
The file service stores this value but does not use or modify it.
contentDispositionstring <optional>
The file's content disposition.
contentMD5string <optional>
The file's MD5 hash.
metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
textstring | object The file text, as a string or in a Buffer.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description speedSummarySpeedSummary <optional>
The upload tracker objects;
storeFileContentMD5bool <optional>
Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.useTransactionalMD5bool <optional>
Calculate and send/validate content MD5 for transactions.
contentSettingsobject <optional>
The file's content settings.
Properties
Name Type Argument Description contentTypestring <optional>
The MIME content type of the file. The default type is application/octet-stream.
contentEncodingstring <optional>
The content encodings that have been applied to the file.
contentLanguagestring <optional>
The natural languages used by this resource.
cacheControlstring <optional>
The file service stores this value but does not use or modify it.
contentDispositionstring <optional>
The file's content disposition.
contentMD5string <optional>
The file's MD5 hash.
metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackFileService~FileToText errorwill contain information
if an error occurs; otherwisetextwill contain the file contents,
andfilewill contain the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
readStreamReadable The Node.js Readable stream.
rangeStartint The range start.
rangeEndint The range end.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description useTransactionalMD5bool <optional>
Calculate and send/validate content MD5 for transactions.
transactionalContentMD5string <optional>
An optional hash value used to ensure transactional integrity for the page.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
rangeStartstring <optional>
Return only the bytes of the file in the specified range.
rangeEndstring <optional>
Return only the bytes of the file in the specified range.
useTransactionalMD5boolean <optional>
When set to true, Calculate and send/validate content MD5 for transactions.
disableContentMD5Validationboolean <optional>
When set to true, MD5 validation will be disabled when downloading files.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description quotaint <optional>
Specifies the maximum size of the share, in gigabytes.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.metadataobject <optional>
The metadata key/value pairs.
timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the share information.
responsewill 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 sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.metadataobject <optional>
The metadata key/value pairs.
timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the share information includingcreatedboolean member.
responsewill 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 sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.metadataobject <optional>
The metadata key/value pairs.
timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the ID of the snapshot.
responsewill 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 theStreamreturned by this API should be used with piping.This:
Parameters:
Name Type Argument Description sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description speedSummarySpeedSummary <optional>
The download tracker objects;
storeFileContentMD5bool <optional>
Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.useTransactionalMD5bool <optional>
Calculate and send/validate content MD5 for transactions.
contentSettingsobject <optional>
The file's content settings.
Properties
Name Type Argument Description contentTypestring <optional>
The MIME content type of the file. The default type is application/octet-stream.
contentEncodingstring <optional>
The content encodings that have been applied to the file.
contentLanguagestring <optional>
The natural languages used by this resource.
cacheControlstring <optional>
The file service stores this value but does not use or modify it.
contentDispositionstring <optional>
The file's content disposition.
contentMD5string <optional>
The file's MD5 hash.
metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 theStreamreturned by this API should be used with piping.This:
Parameters:
Name Type Argument Description sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
lengthstring The file length.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description speedSummarySpeedSummary <optional>
The download tracker objects;
storeFileContentMD5bool <optional>
Specifies whether the file's ContentMD5 header should be set on uploads.
The default value is false for files.useTransactionalMD5bool <optional>
Calculate and send/validate content MD5 for transactions.
contentSettingsobject <optional>
The file's content settings.
Properties
Name Type Argument Description contentTypestring <optional>
The MIME content type of the file. The default type is application/octet-stream.
contentEncodingstring <optional>
The content encodings that have been applied to the file.
contentLanguagestring <optional>
The natural languages used by this resource.
cacheControlstring <optional>
The file service stores this value but does not use or modify it.
contentDispositionstring <optional>
The file's content disposition.
contentMD5string <optional>
The file's MD5 hash.
metadataobject <optional>
The metadata key/value pairs.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 sharestring The share name.
directorystring The directory name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResponse errorwill contain information
if an error occurs; otherwise
responsewill 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 sharestring The share name.
directorystring The directory name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill
be true if the directory exists and was deleted, or false if the directory
did not exist.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResponse errorwill contain information
if an error occurs;responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill
be true if the file was deleted, or false if the file
does not exist.
responsewill 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 sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description deleteSnapshotsstring <optional>
The snapshot delete option. See azure.FileUtilities.ShareSnapshotDeleteOptions.*.
shareSnapshotIdstring <optional>
The share snapshot identifier.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResponse errorwill contain information
if an error occurs; otherwise
responsewill 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 sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description deleteSnapshotsstring <optional>
The snapshot delete option. See azure.FileUtilities.ShareSnapshotDeleteOptions.*.
shareSnapshotIdstring <optional>
The share snapshot identifier.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill
be true if the share exists and was deleted, or false if the share
did not exist.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The share snapshot identifier.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the directory information includingexistsboolean member.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackfunction errorwill contain information
if an error occurs; otherwiseresultwill contain
the file information including theexistsboolean member.
responsewill 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 sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the share information includingexistsboolean member.
responsewill contain information related to this operation. -
generateSharedAccessSignature(share [, directory] [, file], sharedAccessPolicy [, headers])
-
Retrieves a shared access signature token.
This:
Parameters:
Name Type Argument Description sharestring The share name.
directorystring <optional>
The directory name. Use '' to refer to the base directory.
filestring <optional>
The file name.
sharedAccessPolicyobject The shared access policy.
Properties
Name Type Argument Description Idstring <optional>
The signed identifier.
AccessPolicy.Permissionsobject <optional>
The permission type.
AccessPolicy.Startdate | string <optional>
The time at which the Shared Access Signature becomes valid (The UTC value will be used).
AccessPolicy.Expirydate | string <optional>
The time at which the Shared Access Signature becomes expired (The UTC value will be used).
AccessPolicy.IPAddressOrRangestring <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.Protocolsstring <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.headersobject <optional>
The optional header values to set for a file returned wth this SAS.
Properties
Name Type Argument Description cacheControlstring <optional>
The optional value of the Cache-Control response header to be returned when this SAS is used.
contentTypestring <optional>
The optional value of the Content-Type response header to be returned when this SAS is used.
contentEncodingstring <optional>
The optional value of the Content-Encoding response header to be returned when this SAS is used.
contentLanguagestring <optional>
The optional value of the Content-Language response header to be returned when this SAS is used.
contentDispositionstring <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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information about the directory.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information for the directory.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information about the file.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information about the file.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
localFileNamestring The local path to the file to be downloaded.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
skipSizeCheckboolean <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.speedSummarySpeedSummary <optional>
The download tracker objects.
parallelOperationThreadCountint <optional>
The number of parallel operations that may be performed when uploading.
rangeStartstring <optional>
Return only the bytes of the file in the specified range.
rangeEndstring <optional>
Return only the bytes of the file in the specified range.
useTransactionalMD5boolean <optional>
When set to true, Calculate and send/validate content MD5 for transactions.
disableContentMD5Validationboolean <optional>
When set to true, MD5 validation will be disabled when downloading files.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
writeStreamWritable The Node.js Writable stream.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
skipSizeCheckboolean <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.speedSummarySpeedSummary <optional>
The download tracker objects.
parallelOperationThreadCountint <optional>
The number of parallel operations that may be performed when uploading.
rangeStartstring <optional>
Return only the bytes of the file in the specified range.
rangeEndstring <optional>
Return only the bytes of the file in the specified range.
useTransactionalMD5boolean <optional>
When set to true, Calculate and send/validate content MD5 for transactions.
disableContentMD5Validationboolean <optional>
When set to true, MD5 validation will be disabled when downloading files.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
rangeStartint <optional>
The range start.
rangeEndint <optional>
The range end.
disableContentMD5Validationboolean <optional>
When set to true, MD5 validation will be disabled when downloading files.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackFileService~FileToText errorwill contain information
if an error occurs; otherwisetextwill contain the file contents,
andfilewill contain the file information.
responsewill 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 optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs; otherwise,resultwill contain the properties
andresponsewill contain information related to this operation. -
getShareAcl(share [, options], callback)
-
Gets the share's ACL.
This:
Parameters:
Name Type Argument Description sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information for the share.
responsewill 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 sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information for the share.
responsewill 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 sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information for the share.
responsewill contain information related to this operation. -
getShareStats(share [, options], callback)
-
Gets the share statistics for a share.
This:
Parameters:
Name Type Argument Description sharestring The share name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs; otherwise,resultwill contain the stats and
responsewill contain information related to this operation. -
getUrl(share, directory [, file] [, sasToken] [, primary] [, shareSnapshotId])
-
Retrieves a file or directory URL.
Parameters:
Name Type Argument Description sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring <optional>
The file name. File names may not start or end with the delimiter '/'.
sasTokenstring <optional>
The Shared Access Signature token.
primaryboolean <optional>
A boolean representing whether to use the primary or the secondary endpoint.
shareSnapshotIdstring <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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
currentTokenobject A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
maxResultsint <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)
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
entries.files which contains a list offiles, entries.directories which contains a list ofdirectoriesand the continuationToken for the next listing operation.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
prefixstring The prefix of the directory/files name.
currentTokenobject A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
maxResultsint <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)
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
entries.files which contains a list offiles, entries.directories which contains a list ofdirectoriesand the continuationToken for the next listing operation.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description shareSnapshotIdstring <optional>
The snapshot identifier of the share.
rangeStartint <optional>
The range start.
rangeEndint <optional>
The range end.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
the range information.
responsewill 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 currentTokenobject A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.maxResultsint <optional>
Specifies the maximum number of shares to return per call to Azure storage.
includestring <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.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill containentriesandcontinuationToken.
entriesgives a list ofsharesand thecontinuationTokenis used for the next listing operation.
responsewill 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 prefixstring The prefix of the share name.
currentTokenobject A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.prefixstring <optional>
Filters the results to return only shares whose name begins with the specified prefix.
maxResultsint <optional>
Specifies the maximum number of shares to return per call to Azure storage.
includestring <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.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill containentriesandcontinuationToken.
entriesgives a list ofsharesand thecontinuationTokenis used for the next listing operation.
responsewill contain information related to this operation. -
resizeFile(share, directory, file, size [, options], callback)
-
Resizes a file.
This:
Parameters:
Name Type Argument Description sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
sizeString The size of the file, in bytes.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information about the file.
responsewill 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 servicePropertiesobject The service properties.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResponse errorwill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
metadataobject The metadata key/value pairs.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information on the directory.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
metadataobject The metadata key/value pairs.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information on the file.
responsewill 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 sharestring The share name.
directorystring The directory name. Use '' to refer to the base directory.
filestring The file name. File names may not start or end with the delimiter '/'.
propertiesobject <optional>
The file properties to set.
Properties
Name Type Argument Description contentTypestring <optional>
The MIME content type of the file. The default type is application/octet-stream.
contentEncodingstring <optional>
The content encodings that have been applied to the file.
contentLanguagestring <optional>
The natural languages used by this resource.
cacheControlstring <optional>
The file's cache control.
contentDispositionstring <optional>
The file's content disposition.
contentLengthstring <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.contentMD5string <optional>
The file's MD5 hash.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information about the file.
responsewill contain information related to this operation. -
setProxy(proxy)
-
Sets proxy object specified by caller.
Parameters:
Name Type Description proxyobject 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 servicePropertiesobject The service properties.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResponse errorwill 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 sharestring The share name.
signedIdentifiersObject.<string, AccessPolicy> The share ACL settings. See
AccessPolicyfor detailed information.optionsobject <optional>
The request options.
Properties
Name Type Argument Description timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwiseresultwill contain
information for the share.
responsewill 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 sharestring The share name.
metadataobject The metadata key/value pairs.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResponse errorwill contain information
if an error occurs; otherwise
responsewill contain information related to this operation. -
setShareProperties(share [, properties] [, options], callback)
-
Sets the properties for the specified share.
This:
Parameters:
Name Type Argument Description sharestring The share name.
propertiesobject <optional>
The share properties to set.
Properties
Name Type Argument Description quotastring | int <optional>
Specifies the maximum size of the share, in gigabytes.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information
if an error occurs; otherwisesharewill contain
information about the share.
responsewill 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 sourceUristring The source file or blob URI.
targetSharestring The target share name.
targetDirectorystring The target directory name.
targetFilestring The target file name.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description metadataobject <optional>
The target file metadata key/value pairs.
accessConditionsAccessConditions <optional>
The access conditions.
sourceAccessConditionsAccessConditions <optional>
The source access conditions.
locationModeLocationMode <optional>
Specifies the location mode used to decide which location the request should be sent to.
Please see StorageUtilities.LocationMode for the possible values.timeoutIntervalInMsint <optional>
The server timeout interval, in milliseconds, to use for the request.
clientRequestTimeoutInMsint <optional>
The timeout of client requests, in milliseconds, to use for the request.
maximumExecutionTimeInMsint <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.clientRequestIdstring <optional>
A string that represents the client request ID with a 1KB character limit.
useNagleAlgorithmbool <optional>
Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false.
The default value is false.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the file information.
responsewill 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 filterObject 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 errorobject If an error occurs, the error information.
textstring The text returned from the file.
fileobject Information about the file.
responseobject Information related to this operation.