0 out of 5 rated this helpful - Rate this topic

Query Tables (REST API)

The Query Tables operation returns a list of tables under the specified account.

The Query Tables request may be constructed as follows. HTTPS is recommended. Replace myaccount with the name of your storage account:

 

Method Request URI HTTP Version

GET

https://myaccount.table.core.windows.net/Tables

HTTP/1.1

Emulated Storage Service URI

When making a request against the emulated storage service, specify the emulator hostname and Table service port as 127.0.0.1:10002, followed by the emulated storage account name:

 

Method Request URI HTTP Version

GET

http://127.0.0.1:10002/devstoreaccount1/Tables

HTTP/1.1

The Table service in the emulated storage service differs from the Windows® Azure™ Table service in several ways. For more information, see About Development Storage and Differences between Development Storage and Cloud Storage Services.

URI Parameters

The Query Tables operation supports the query options defined by WCF Data Services. For more information, see Querying the Data Service.

Request Headers

The following table describes required and optional request headers.

 

Request header Description

Authorization

Required. Specifies the authentication scheme, account name, and signature. For more information, see Authentication for the Windows Azure Storage Services.

Date or x-ms-date

Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authentication for the Windows Azure Storage Services.

x-ms-version

Optional. Specifies the version of the operation to use for this request. For more information, see Versioning for the Blob, Queue, and Table services in Windows Azure.

Request Body

None.

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

A successful operation returns status code 200 (OK).

For information about status codes, see Status and Error Codes and Table Service Error Codes.

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

 

Response header Description

x-ms-continuation-NextTableName

If the number of tables to be returned exceeds 1,000 or the query does not complete within the timeout interval, the response header includes the x-ms-continuation-NextTableName continuation header. This header returns the continuation token value. For more information about using the continuation token, see Query Timeout and Pagination.

x-ms-request-id

This header uniquely identifies the request that was made and can be used for troubleshooting the request. For more information, see Troubleshooting API Operations.

x-ms-version

Indicates the version of the Table service used to execute the request. This header is returned for requests made against version 2009-09-19 and later.

Date

A UTC date/time value generated by the service that indicates the time at which the response was initiated.

Response Body

The Query Tables operation returns the list of tables in the account as a WCF entity set, which is an Atom feed.

Here is a sample response body for the Query Tables operation.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="https://myaccount.table.core.windows.net/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Tables</title>
  <id>https://myaccount.table.core.windows.net/Tables</id>
  <updated>2009-01-04T17:18:54.7062347Z</updated>
  <link rel="self" title="Tables" href="Tables" />
  <entry>
    <id>https://myaccount.table.core.windows.net/Tables('mytable')</id>
    <title type="text"></title>
    <updated>2009-01-04T17:18:54.7062347Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="Tables" href="Tables('mytable')" />
    <category term="myaccount.Tables" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:TableName>mytable</d:TableName>
      </m:properties>
    </content>
  </entry>
</feed> 

Only the account owner may call this operation.

For additional information on addressing Table service resources, see WCF Web HTTP Programming Model Overview.

A query against the Table service may return a maximum of 1,000 tables at one time and may execute for a maximum of five seconds. If the result set contains more than 1,000 tables, if the query did not complete within five seconds, or if the query crosses the partition boundary, the response includes a custom header containing the x-ms-continuation-NextTableName continuation token. The continuation token may be used to construct a subsequent request for the next page of data. For more information about continuation tokens, see Query Timeout and Pagination.

Note that the total time allotted to the request for scheduling and processing the query is 30 seconds, including the five seconds for query execution.

You can use the WCF Data Services Client Library to construct a query using LINQ. For more information about supported query operations against the Table service through LINQ, see Query Operators (Table Service Support) and Writing LINQ Queries.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.
facebook page visit twitter rss feed newsletter