The tool supports REST operations: GET, Query, POST (create), PUT (update), and DELETE. The UI shows a button for each of these operations.
Get
The GET operation retrieves a single flexible entity. The entity returned depends on the scope specified in the Address Bar:
-
If an authority is in scope (for example,
https://<authority-id>.data.database.windows.net/v1/), the GET operation returns the specific authority metadata.
-
If a container is in scope (for example,
https://<authority-id>.data.database.windows.net/v1/<container-id>), the GET operation returns the specific container metadata.
-
If an entity is in scope (for example,
https://<authority-id>.data.database.windows.net/v1/<container-id>/<entity-id>), the GET operation returns the specific entity.
For blob entities, the Get button drop down provides options to get the blob entity (only metadata) or the blob itself. If you choose to retrieve the blob itself, a file dialog opens allowing user to select a folder and file name where the retrieved blob is saved. The content-disposition metadata attribute provides the default file name. User can specify any file name to store the blob.
Query
Querying involves the following steps:
-
Specify appropriate scope in the Address Bar.
-
If an authority is in scope, query returns container metadata for all containers satisfying the query.
-
If a container is in scope, the query returns entities satisfying the query. For blob entities, the query returns only the blob metadata. The Get operation should be used to retrieve one blob at a time.
-
Specify query in the Query box.
-
Press the Query button.
For additional information on queries, see Querying SQL Data Services.
Create
To create (POST) a flexible entity (Authority, Container or an Entity) an XML payload describing the entity is needed. The tool provides necessary XML templates making it easy to define the XML payload. Pressing one of the Template buttons displays the XML in the editor window.
The Property buttons are useful when adding flexible properties (user-defined properties) to the entity being created or updated. There is a property button for each data type supported in SDS. These buttons add a new property, with a generic name and value, to the XML template in the editor. You will need to update the XML and provide an appropriate property name and value.
The Content property button is useful when working with blobs. When creating a blob entity, the Blob button provides the following default template:
<s:Entity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:s="http://schemas.microsoft.com/sitka/2008/03/">
<s:Id>SomeGUIDId</s:Id>
<s:Content />
</s:Entity>
This template has an empty <Content/> element. In this case the tool computes the values of the <Content/> metadata attributes (content-disposition, content-type, content-length) from the input blob. After the blob is created, if you retrieve (Get) the blob, you can see the computed metadata attribute values as shown in the following sample blob entity:
<s:Entity xmlns:s="http://schemas.microsoft.com/sitka/2008/03/"
xmlns:x="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<s:Id>SomeJPEGImage</s:Id>
<s:Version>1030835</s:Version>
<s:Content content-type="image/jpeg" content-length="1723" content-disposition="inline; filename=SampleImage.jpg" />
</s:Entity>
You can optionally provide these metadata attribute values. After selecting the Blob template, press the Content button. It adds these attributes to the <Content> template. User can then provide values for these attributes.
Update
The update (PUT) action can be used to update an entity. Only user-defined properties can be added, updated or deleted. Metadata property updates are not supported. Therefore, the authority and container entities cannot be updated because they only have metadata properties. Also, blob entities have only metadata properties and they cannot be updated. However, blob itself can be updated (replaced).
Delete
You can delete a container or an entity. When a container is deleted, all the entities in that container are also deleted. Authority deletion is not supported. To delete a container or an entity:
-
Ensure Address Bar specifies appropriate scope.
-
Press the Delete button.