0 out of 3 rated this helpful - Rate this topic

Create Table (REST API)

The Create Table operation creates a new table in the storage account.

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

 

Method Request URI HTTP Version

POST

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

POST

http://127.0.0.1:10002/devstoreaccount1/Tables

HTTP/1.1

The Table service in the storage emulator 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

None.

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.

Content-Type

Required. The content type of the request body. Currently, this header should be set to application/atom+xml.

Content-Length

Required. The length of the request body.

Request Body

The request body specifies the name of the table to be created. Note that table names must conform to the naming restrictions described in Understanding the Table Storage Data Model.

The request body is a WCF entity set, which is an Atom feed. It has the following general format.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>   
  <entry 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 /> 
    <updated>2009-03-18T11:48:34.9840639-07:00</updated> 
    <author>
      <name/> 
    </author> 
      <id/> 
      <content type="application/xml">
        <m:properties>
          <d:TableName>mytable</d:TableName>
        </m:properties>
      </content> 
    </entry>

For guidance about valid table names, see the "Table Names" section in Understanding the Table Service Data Model.

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

Status Code

A successful operation returns status code 201 (Created).

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-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 response body is also a WCF entity set.

Here is a sample XML response for the Create Table operation.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry 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"> <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>

Only the account owner may call this operation.

None.

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