Share via


st get

[This document supports a preliminary release of a software product that may be changed substantially prior to final commercial release. This document is provided for informational purposes only.]

Retrieves specified entity.

st get <authorityid> [<containerid> | [<entityid>]]
       <credentials> 
       [/REST | /SOAP] [/parallel:<number>]
       [/verbose] [/accept] [/console]

For blob entities, depending on the content type specified in the /accept option the get command returns either the blob metadata or the blob itself. If content type is

  • application/x-sdds+xml, the get command returns the blob metadata.
  • For any other content type, if the specified content type matches the blob entity's content type, then the get command retrieves the blob and stores it in a file in the working folder. The file name is derived from the file name in the content-disposition in the blob entity. If file name cannot be derived, the get command generates a GUID value for the file name.

Examples

Examples of the get command are given below.

Example 1 Retrieve an authority, a container or an entity

To retrieve authority metadata you specify the authority id in the get command. The following example retrieves metadata for myauth authority.

cmdPrompt>st get myauth /host:data.database.windows.net /user:userName 

To retrieve container metadata you specify the authority id and the container id in the get command. The following example retrieves metadata for container c1 in myauth authority.

cmdPrompt>st get myauth c1 /host:data.database.windows.net /user:userName 

To retrieve an entity you specify authority id, container id and entity id. The following command retrieves entity e1 in container c1 in authority myauth.

cmdPrompt>st get myauth c1 e1 /host:data.database.windows.net/user:userName 

Example 2 Retrieve a blob entity

The following get command retrieves a blob entity.

cmdPrompt>st get myauth c1 blob1 /accept:"application/x-ssds+xml" /host:data.database.windows.net /user:userName              

It specifies application/x-sdds+xml content type in the /console option. Therefore the get command returns the blob entity metadata as shown in this sample XML fragment.

<s:Entity xmlns:s="https://schemas.microsoft.com/sitka/2008/03/" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns:x="http://www.w3.org/2001/XMLSchema">
  <s:Id>blob1</s:Id>
  <s:Version>2022</s:Version>
  <s:Content content-type="image/jpeg" content-length="1723" 
             content-disposition="attachment; filename=blob1.jpg" />
</s:Entity>

To retrieve the blob, and not its metadata, optionally specify the content type, in this case image/jpeg, in the /accept option.

cmdPrompt>st get myauth c1 blob1 /accept:"image/jpeg" /host:data.database.windows.net /user:userName 

The blob is retrieved and stored in a file (blob1.jpg) in the working folder. The file name is derived from the file name value in the content-disposition metadata of the blob entity.

If you add the /console option, the command writes the blob to the console window.

See Also

Concepts

SDS Command Line Tool