Class: QueueService

QueueService

The QueueService class is used to perform operations on the Microsoft Azure Queue Service.

For more information on using the Queue Service, as well as task focused information on using it from a Node.js application, see
How to Use the Queue Service from Node.js.
The following defaults can be set on the Queue service.
messageEncoder The message encoder to specify how QueueService encodes and decodes the queue message. Default is TextXmlQueueMessageEncoder.
defaultTimeoutIntervalInMs The default timeout interval, in milliseconds, to use for request made via the Queue service.
defaultClientRequestTimeoutInMs The default timeout of client requests, in milliseconds, to use for the request made via the Queue service.
defaultMaximumExecutionTimeInMs The default maximum execution time across all potential retries, for requests made via the Queue service.
defaultLocationMode The default location mode for requests made via the Queue service.
useNagleAlgorithm Determines whether the Nagle algorithm is used for requests made via the Queue service; true to use the
Nagle algorithm; otherwise, false. The default value is false.
enableGlobalHttpAgent Determines whether global HTTP(s) agent is enabled; true to use Global HTTP(s) agent; otherwise, false to use
http(s).Agent({keepAlive:true}).


new QueueService( [storageAccountOrConnectionString] [, storageAccessKey] [, host] [, sas] [, endpointSuffix] [, token])

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

Parameters:
Name Type Argument Description
storageAccountOrConnectionString string <optional>

The storage account or the connection string.

storageAccessKey string <optional>

The storage access key.

host string | object <optional>

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

sas string <optional>

The Shared Access Signature string.

endpointSuffix string <optional>

The endpoint suffix.

token TokenCredential <optional>

The TokenCredential object.

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:

messageEncoder

Properties:
Name Type Description
QueueService#messageEncoder boolean
Default Value:
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:

clearMessages(queue [, options], callback)

Clears all messages from the queue.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResponse

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

Source:

createMessage(queue, messageText [, options], callback)

Adds a new message to the back of the message queue.
The encoded message can be up to 64KB in size for versions 2011-08-18 and newer, or 8KB in size for previous versions.
Unencoded messages must be in a format that can be included in an XML request with UTF-8 encoding.
Queue messages are encoded using the TextXmlQueueMessageEncoder. See queueService.messageEncoder to set encoder defaults.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

messageText string | Buffer

The message text.

options object <optional>

The request options.

Properties
Name Type Argument Description
messageTimeToLive int <optional>

The time-to-live interval for the message, in seconds. The maximum time-to-live allowed is 7 days. If this parameter is omitted, the default time-to-live is 7 days

visibilityTimeout int <optional>

Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message cannot be set to a value later than the expiry time. visibilitytimeout should be set to a value smaller than the time-to-live value.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:
Example
var azure = require('azure-storage');
var queueService = azure.createQueueService();
queueService.createMessage('taskqueue', 'Hello world!', function(error) {
  if(!error) {
    // Message inserted
  }
});

createQueue(queue [, options], callback)

Creates a new queue under the given account.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

createQueueIfNotExists(queue [, options], callback)

Creates a new queue under the given account if it doesn't exist.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
metadata object <optional>

The metadata key/value pairs.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:
Example
var azure = require('azure-storage');
var queueService = azure.createQueueService();
queueService.createQueueIfNotExists('taskqueue', function(error) {
  if(!error) {
    // Queue created or exists
  }
}); 

deleteMessage(queue, messageId, popReceipt [, options], callback)

Deletes a specified message from the queue.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

messageId string

The message identifier of the message to delete.

popReceipt string

A valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResponse

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

Source:

deleteQueue(queue [, options], callback)

Permanently deletes the specified queue.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResponse

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

Source:

deleteQueueIfExists(queue [, options], callback)

Permanently deletes the specified queue if it exists.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
'true' if the queue was deleted and 'false' if the queue did not exist.
response will contain information related to this operation.

Source:

doesQueueExist(queue [, options], callback)

Checks to see if a queue exists.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback function

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

Source:

generateSharedAccessSignature(queue, sharedAccessPolicy)

Retrieves a shared access signature token.

This:
Parameters:
Name Type Description
queue string

The queue name.

sharedAccessPolicy object

The shared access policy.

Properties
Name Type Argument Description
Id string <optional>

The signed identifier.

AccessPolicy.Permissions object <optional>

The permission type.

AccessPolicy.Start date | string <optional>

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

AccessPolicy.Expiry date | string <optional>

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

AccessPolicy.IPAddressOrRange string <optional>

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

AccessPolicy.Protocols string

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.

Source:
Returns:

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

Type
string

getMessage(queue [, options], callback)

Retrieves a message from the queue and makes it invisible to other consumers.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
visibilityTimeout int <optional>

Required if not peek only. Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:
Example
var azure = require('azure-storage');
var queueService = azure.createQueueService();
var queueName = 'taskqueue';
queueService.getMessage(queueName, function(error, serverMessage) {
  if(!error) {
    // Process the message in less than 30 seconds, the message
    // text is available in serverMessage.messagetext
    queueService.deleteMessage(queueName, serverMessage.messageId, serverMessage.popReceipt, function(error) {
      if(!error){
          // Message deleted
      }
    });
  }
});

getMessages(queue [, options], callback)

Retrieve messages from the queue and makes them invisible to other consumers.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
numOfMessages int <optional>

A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. By default, a single message is retrieved from the queue with this operation.

visibilityTimeout int <optional>

Required if not peek only. Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

error will contain information
if an error occurs; otherwise result will contain
a list of messages.
response will contain information related to this operation.

Source:
Example
var azure = require('azure-storage');
var queueService = azure.createQueueService();
var queueName = 'taskqueue';
queueService.getMessages(queueName, function(error, serverMessages) {
  if(!error) {
    // Process the message in less than 30 seconds, the message
    // text is available in serverMessages[0].messagetext
    queueService.deleteMessage(queueName, serverMessages[0].messageId, serverMessages[0].popReceipt, function(error) {
      if(!error){
          // Message deleted
      }
    });
  }
});

getQueueAcl(queue [, options], callback)

Gets the queue's ACL.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

getQueueMetadata(queue [, options], callback)

Returns queue properties, including user-defined metadata.
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
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

getServiceProperties( [options], callback)

Gets the properties of a storage account’s Queue service, including Microsoft Azure Storage Analytics.

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

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

getServiceStats( [options], callback)

Gets the service stats for a storage account’s Queue service.

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

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

getUrl(queue [, sasToken] [, primary])

Retrieves a queue URL.

Parameters:
Name Type Argument Description
queue string

The queue name.

sasToken string <optional>

The Shared Access Signature token.

primary boolean <optional>

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

Source:
Returns:

The formatted URL string.

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

var sasToken = queueService.generateSharedAccessSignature(queue, sharedAccessPolicy);
var sasUrl = queueService.getUrl(queue, sasToken);

listQueuesSegmented(currentToken [, options], callback)

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

This:
Parameters:
Name Type Argument Description
currentToken object

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

options object <optional>

The request options.

Properties
Name Type Argument Description
maxResults int <optional>

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

include string <optional>

Include this parameter to specify that the queue's metadata be returned as part of the response body. (allowed values: '', 'metadata')
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.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

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

Lists a segment containing a collection of queue items under the given account.

This:
Parameters:
Name Type Argument Description
prefix string

The prefix of the queue name.

currentToken object

A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.* @param {string} [options.prefix] Filters the results to return only queues whose name begins with the specified prefix.

options object <optional>

The request options.

Properties
Name Type Argument Description
marker string <optional>

String value that identifies the portion of the list to be returned with the next list operation.

maxResults int <optional>

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

include string <optional>

Include this parameter to specify that the queue's metadata be returned as part of the response body. (allowed values: '', 'metadata')
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.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

peekMessage(queue [, options], callback)

Retrieves a message from the front of the queue, without changing the message visibility.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

peekMessages(queue [, options], callback)

Retrieves messages from the front of the queue, without changing the messages visibility.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
numOfMessages int <optional>

A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. By default, a single message is retrieved from the queue with this operation.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

setAccountServiceProperties(serviceProperties [, options], callback)

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

This:
Parameters:
Name Type Argument Description
serviceProperties object

The service properties.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResponse

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

Inherited From:
Source:

setProxy(proxy)

Sets proxy object specified by caller.

Parameters:
Name Type Description
proxy object

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

Inherited From:
Source:

setQueueAcl(queue [, options], callback)

Updates the queue's ACL.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Properties:
Name Type Description
signedIdentifiers Object.<string, AccessPolicy>

The container ACL settings. See AccessPolicy for detailed information.

Source:
Example
var azure = require('azure-storage');
var SharedAccessPermissions = azure.QueueUtilities.SharedAccessPermissions;
var queueService = azure.createQueueService();
var sharedAccessPolicies = [
{AccessPolicy: {
    Permissions: PROCESS,
    Start: startDate,
    Expiry: expiryDate
  },
  Id: processOnly,
},
{AccessPolicy: {
    Permissions: SharedAccessPermissions.PROCESS + SharedAccessPermissions.DELETE,
    Start: startDate,
    Expiry: expiryDate
  },
  Id: processAndDelete,
}];

queueService.setQueueAcl(queueName, sharedAccessPolicies, function(error, queueResult, response) {
    // do whatever
});

setQueueMetadata(queue, metadata [, options], callback)

Sets user-defined metadata on the specified queue. Metadata is associated with the queue as name-value pairs.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

metadata object

The metadata key/value pairs.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

setServiceProperties(serviceProperties [, options], callback)

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

This:
Parameters:
Name Type Argument Description
serviceProperties object

The service properties.

options object <optional>

The request options.

Properties
Name Type Argument Description
locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResponse

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

Source:

updateMessage(queue, messageId, popReceipt, visibilityTimeout [, options], callback)

Updates the visibility timeout of a message. You can also use this operation to update the contents of a message.
A message must be in a format that can be included in an XML request with UTF-8 encoding, and the encoded message can be up to 64KB in size.

This:
Parameters:
Name Type Argument Description
queue string

The queue name.

messageId string

The message identifier of the message to update.

popReceipt string

A valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation

visibilityTimeout int

Specifies the new visibility timeout value, in seconds, relative to server time. The new value must be larger than or equal to 0, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time.

options object <optional>

The request options.

Properties
Name Type Argument Description
messageText object <optional>

The new message text.

locationMode LocationMode <optional>

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

timeoutIntervalInMs int <optional>

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

clientRequestTimeoutInMs int <optional>

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

maximumExecutionTimeInMs int <optional>

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

clientRequestId string <optional>

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

useNagleAlgorithm bool <optional>

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

callback errorOrResult

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

Source:

withFilter(filter)

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

"function handle (requestOptions, next)".

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

"function (returnObject, finalCallback, next)"

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

Parameters:
Name Type Description
filter Object

The new filter object.

Inherited From:
Source:
Returns:

A new service client with the filter applied.

Type
StorageServiceClient