new TableService( [storageAccountOrConnectionString] [, storageAccessKey] [, host] [, sasToken] [, endpointSuffix])
Creates a new TableService 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:
-
createTable(table [, options], callback)
-
Creates a new table within a storage account.
This:
Parameters:
Name Type Argument Description tablestring The table 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 the new table information.
responsewill contain information related to this operation.- Source:
-
createTableIfNotExists(table [, options], callback)
-
Creates a new table within a storage account if it does not exists.
This:
Parameters:
Name Type Argument Description tablestring The table 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;
resultwill contain the table information includingcreatedboolean member
responsewill contain information related to this operation.- Source:
Example
var azure = require('azure-storage'); var tableService = azure.createTableService(); tableService.createTableIfNotExists('tasktable', function(error) { if(!error) { // Table created or exists } }); -
deleteEntity(table, entityDescriptor [, options], callback)
-
Deletes an entity within a table. To delete conditionally based on etag, set entity['.metadata']['etag'].
This:
Parameters:
Name Type Argument Description tablestring The table name.
entityDescriptorobject The entity descriptor.
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.- Source:
-
deleteTable(table [, options], callback)
-
Deletes a table from a storage account.
This:
Parameters:
Name Type Argument Description tablestring The table 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;
responsewill contain information related to this operation.- Source:
-
deleteTableIfExists(table [, options], callback)
-
Deletes a table from a storage account, if it exists.
This:
Parameters:
Name Type Argument Description tablestring The table 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;
resultwill betrueif table was deleted, false otherwise
responsewill contain information related to this operation.- Source:
-
doesTableExist(table [, options], callback)
-
Checks whether or not a table exists on the service.
This:
Parameters:
Name Type Argument Description tablestring The table 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 the table information includingexistsboolean member.
responsewill contain information related to this operation.- Source:
-
executeBatch(table, batch [, options], callback)
-
Executes the operations in the batch.
This:
Parameters:
Name Type Argument Description tablestring The table name.
batchTableBatch The table batch to execute.
optionsobject <optional>
The create options or callback function.
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 responses for each operation executed in the batch;
result.entitywill contain the entity information for each operation executed.
result.responsewill contain the response for each operations executed.
responsewill contain information related to this operation.- Source:
-
generateSharedAccessSignature(table, sharedAccessPolicy)
-
Retrieves a shared access signature token.
This:
Parameters:
Name Type Description tablestring The table 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.AccessPolicy.StartPkstring <optional>
The starting Partition Key for which the SAS will be valid.
AccessPolicy.EndPkstring <optional>
The ending Partition Key for which the SAS will be valid.
AccessPolicy.StartRkstring <optional>
The starting Row Key for which the SAS will be valid.
AccessPolicy.EndRkstring <optional>
The ending Row Key for which the SAS will be valid.
- Source:
Returns:
An object with the shared access signature.
- Type
- object
-
getServiceProperties( [options], callback)
-
Gets the properties of a storage account’s Table 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;
otherwiseresultwill contain the properties.
responsewill contain information related to this operation.- Source:
-
getServiceStats( [options], callback)
-
Gets the service stats for a storage account’s Table service.
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;
otherwiseresultwill contain the stats.
responsewill contain information related to this operation.- Source:
-
getTableAcl(table [, options], callback)
-
Gets the table's ACL.
This:
Parameters:
Name Type Argument Description tablestring The table 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 the ACL information for the table. SeeAccessPolicyfor detailed information.
responsewill contain information related to this operation.- Source:
-
getUrl(table [, sasToken] [, primary])
-
Retrieves a table URL.
Parameters:
Name Type Argument Description tablestring The table name.
sasTokenstring <optional>
The Shared Access Signature token.
primaryboolean <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 tableService = azure.createTableService(); var sharedAccessPolicy = { AccessPolicy: { Permissions: azure.TableUtilities.SharedAccessPermissions.QUERY, Start: startDate, Expiry: expiryDate }, }; var sasToken = tableService.generateSharedAccessSignature(table, sharedAccessPolicy); var sasUrl = tableService.getUrl(table, sasToken); -
insertEntity(table, entityDescriptor [, options], callback)
-
Inserts a new entity into a table.
This:
Parameters:
Name Type Argument Description tablestring The table name.
entityDescriptorobject The entity descriptor.
optionsobject <optional>
The request options.
Properties
Name Type Argument Description echoContentstring <optional>
Whether or not to return the entity upon a successful insert. Default to false.
payloadFormatstring <optional>
The payload format to use in the response, if options.echoContent is true.
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.propertyResolverTableService~propertyResolver <optional>
The property resolver. Only applied if echoContent is true. Given the partition key, row key, property name,
property value, and the property Edm type if given by the service, returns the Edm type of the property.entityResolverfunction <optional>
The entity resolver. Only applied if echoContent is true. Given the single entity returned by the insert, returns
a modified object.callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill contain the entity information.
responsewill contain information related to this operation.- Source:
Example
var azure = require('azure-storage'); var tableService = azure.createTableService(); var task1 = { PartitionKey : {'_': 'tasksSeattle', '$':'Edm.String'}, RowKey: {'_': '1', '$':'Edm.String'}, Description: {'_': 'Take out the trash', '$':'Edm.String'}, DueDate: {'_': new Date(2011, 12, 14, 12), '$':'Edm.DateTime'} }; tableService.insertEntity('tasktable', task1, function(error) { if(!error) { // Entity inserted } }); -
insertOrMergeEntity(table, entityDescriptor [, options], callback)
-
Inserts or updates an existing entity within a table by merging new property values into the entity.
This:
Parameters:
Name Type Argument Description tablestring The table name.
entityDescriptorobject The entity descriptor.
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 entity information.
responsewill contain information related to this operation.- Source:
-
insertOrReplaceEntity(table, entityDescriptor [, options], callback)
-
Inserts or updates a new entity into a table.
This:
Parameters:
Name Type Argument Description tablestring The table name.
entityDescriptorobject The entity descriptor.
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 entity information.
responsewill contain information related to this operation.- Source:
-
listTablesSegmented(currentToken [, options], callback)
-
Lists a segment containing a collection of table 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 create options or callback function.
Properties
Name Type Argument Description maxResultsint <optional>
Specifies the maximum number of tables to return per call to Azure ServiceClient.
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.
payloadFormatstring <optional>
The payload format 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 of tables and thecontinuationTokenis used for the next listing operation.
responsewill contain information related to this operation.- Source:
-
listTablesSegmentedWithPrefix(prefix, currentToken [, options], callback)
-
Lists a segment containing a collection of table items under the specified account.
This:
Parameters:
Name Type Argument Description prefixstring The prefix of the table 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 create options or callback function.
Properties
Name Type Argument Description maxResultsint <optional>
Specifies the maximum number of tables to return per call to Azure ServiceClient.
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.
payloadFormatstring <optional>
The payload format 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 of tables and thecontinuationTokenis used for the next listing operation.
responsewill contain information related to this operation.- Source:
-
mergeEntity(table, entityDescriptor [, options], callback)
-
Updates an existing entity within a table by merging new property values into the entity. To merge conditionally based on etag, set entity['.metadata']['etag'].
This:
Parameters:
Name Type Argument Description tablestring The table name.
entityDescriptorobject The entity descriptor.
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 entity information.
response` will contain information related to this operation.- Source:
-
queryEntities(table, tableQuery, currentToken [, options], callback)
-
Queries data in a table. To retrieve a single entity by partition key and row key, use retrieve entity.
This:
Parameters:
Name Type Argument Description tablestring The table name.
tableQueryTableQuery The query to perform. Use null, undefined, or new TableQuery() to get all of the entities in the table.
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.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.
payloadFormatstring <optional>
The payload format to use for the request.
autoResolvePropertiesbool <optional>
If true, guess at all property types.
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.entityResolverfunction <optional>
The entity resolver. Given a single entity returned by the query, returns a modified object which is added to
the entities array.propertyResolverTableService~propertyResolver <optional>
The property resolver. Given the partition key, row key, property name, property value,
and the property Edm type if given by the service, returns the Edm type of the property.callbackTableService~queryResponse errorwill contain information if an error occurs;
otherwiseentrieswill contain the entities returned by the query.
If more matching entities exist, and could not be returned,
queryResultContinuationwill contain a continuation token that can be used
to retrieve the next set of results.
responsewill contain information related to this operation.The logic for returning entity types can get complicated. Here is the algorithm used:
var propertyType; if (propertyResovler) { // If the caller provides a propertyResolver in the options, use it propertyType = propertyResolver(partitionKey, rowKey, propertyName, propertyValue, propertyTypeFromService); } else if (propertyTypeFromService) { // If the service provides us a property type, use it. See below for an explanation of when this will and won't occur. propertyType = propertyTypeFromService; } else if (autoResolveProperties) { // If options.autoResolveProperties is set to true if (javascript type is string) { // See below for an explanation of how and why autoResolveProperties works as it does. propertyType = 'Edm.String'; } else if (javascript type is boolean) { propertyType = 'Edm.Boolean'; } } if (propertyType) { // Set the property type on the property. } else { // Property gets no EdmType. }Notes:
- The service only provides a type if JsonFullMetadata or JsonMinimalMetadata is used, and if the type is Int64, Guid, Binary, or DateTime.
- Explanation of autoResolveProperties:
- String gets correctly resolved to 'Edm.String'.
- Int64, Guid, Binary, and DateTime all get resolved to 'Edm.String.' This only happens if JsonNoMetadata is used (otherwise the service will provide the propertyType in a prior step).
- Boolean gets correctly resolved to 'Edm.Boolean'.
- For both Int32 and Double, no type information is returned, even in the case of autoResolveProperties = true. This is due to an
inability to distinguish between the two in certain cases.
- Source:
Example
var azure = require('azure-storage'); var tableService = azure.createTableService(); // tasktable should already exist and have entities // returns all entities in tasktable, and a continuation token for the next page of results if necessary tableService.queryEntities('tasktable', null, null \/*currentToken*\/, function(error, result) { if(!error) { var entities = result.entries; // do stuff with the returned entities if there are any } }); // returns field1 and field2 of the entities in tasktable, and a continuation token for the next page of results if necessary var tableQuery = new TableQuery().select('field1', 'field2'); tableService.queryEntities('tasktable', tableQuery, null \/*currentToken*\/, function(error, result) { if(!error) { var entities = result.entries; // do stuff with the returned entities if there are any } }); -
replaceEntity(table, entityDescriptor [, options], callback)
-
Replaces an existing entity within a table. To replace conditionally based on etag, set entity['.metadata']['etag'].
This:
Parameters:
Name Type Argument Description tablestring The table name.
entityDescriptorobject The entity descriptor.
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 entity information.
responsewill contain information related to this operation.- Source:
-
retrieveEntity(table, partitionKey, rowKey [, options], callback)
-
Retrieves an entity from a table.
This:
Parameters:
Name Type Argument Description tablestring The table name.
partitionKeystring The partition key.
rowKeystring The row key.
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.
payloadFormatstring <optional>
The payload format to use for the request.
autoResolvePropertiesbool <optional>
If true, guess at all property types.
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.propertyResolverTableService~propertyResolver <optional>
The property resolver. Given the partition key, row key, property name, property value,
and the property Edm type if given by the service, returns the Edm type of the property.entityResolverfunction <optional>
The entity resolver. Given the single entity returned by the query, returns a modified object.
callbackerrorOrResult errorwill contain information if an error occurs;
otherwiseresultwill be the matching entity.
responsewill contain information related to this operation.The logic for returning entity types can get complicated. Here is the algorithm used:
var propertyType; if (propertyResovler) { // If the caller provides a propertyResolver in the options, use it propertyType = propertyResolver(partitionKey, rowKey, propertyName, propertyValue, propertyTypeFromService); } else if (propertyTypeFromService) { // If the service provides us a property type, use it. See below for an explanation of when this will and won't occur. propertyType = propertyTypeFromService; } else if (autoResolveProperties) { // If options.autoResolveProperties is set to true if (javascript type is string) { // See below for an explanation of how and why autoResolveProperties works as it does. propertyType = 'Edm.String'; } else if (javascript type is boolean) { propertyType = 'Edm.Boolean'; } } if (propertyType) { // Set the property type on the property. } else { // Property gets no EdmType. }Notes:
- The service only provides a type if JsonFullMetadata or JsonMinimalMetadata is used, and if the type is Int64, Guid, Binary, or DateTime.
- Explanation of autoResolveProperties:
- String gets correctly resolved to 'Edm.String'.
- Int64, Guid, Binary, and DateTime all get resolved to 'Edm.String.' This only happens if JsonNoMetadata is used (otherwise the service will provide the propertyType in a prior step).
- Boolean gets correctly resolved to 'Edm.Boolean'.
- For both Int32 and Double, no type information is returned, even in the case of autoResolveProperties = true. This is due to an
inability to distinguish between the two in certain cases.
- Source:
Example
var azure = require('azure-storage'); var tableService = azure.createTableService(); tableService.retrieveEntity('tasktable', 'tasksSeattle', '1', function(error, serverEntity) { if(!error) { // Entity available in serverEntity variable } }); -
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:
-
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 Table 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;
responsewill contain information related to this operation.- Source:
-
setTableAcl(table, signedIdentifiers [, options], callback)
-
Updates the table's ACL.
This:
Parameters:
Name Type Argument Description tablestring The table name.
signedIdentifiersObject.<string, AccessPolicy> The table ACL settings. See
AccessPolicyfor detailed information.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 table.
responsewill 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 filterObject The new filter object.
- Inherited From:
- Source:
Returns:
A new service client with the filter applied.
- Type
- StorageServiceClient
Type Definitions
-
propertyResolver(pk, rk, name, value, type)
-
Given the partition key, row key, property name, property value,
and the property Edm type if given by the service, returns the Edm type of the property.Parameters:
Name Type Description pkobject The partition key.
rkobject The row key.
namestring The property name.
valueobject The property value.
typestring The EDM type.
- Source:
-
queryResponse(error, entries, queryResultContinuation, response)
-
Returns entities matched by a query.
Parameters:
Name Type Description errorobject If an error occurs, the error information.
entriesobject The entities returned by the query.
queryResultContinuationobject If more matching entities exist, and could not be returned,
a continuation token that can be used to retrieve more results.responseobject Information related to this operation.
- Source: