Get Data from a Object Store Layer

Note

Currently, the blob service supports REST API versions v1 and v2. Version v1 should be used to access versioned, index and stream (if the stream payload is larger than 1MB) layers. Version v2 should be used to access the object store layer. Always pick the proper API version from API Lookup to ensure you get back the correct API version response. For instructions, see the API Lookup Developer's Guide.

You can get data by requesting its object key in blob v2 REST APIs.

The typical flow for getting data consists of the following steps.

  1. Obtain an authorization token.
  2. Get API base URLs.
  3. Get data by key.

You can list the object keys already stored in your layer by Object Store Listing.

Obtain an Authorization Token

Obtain an authorization token for your HTTP requests. For instructions, see the Identity & Access Management Guide.

Get API Base URLs

Use the API Lookup service to get the API endpoints for the blob v2 APIs for the catalog you want to get data from. For instructions, see the API Lookup Developer's Guide.

Get Data by Key

Use the object key to retrieve data using the blob API.

GET /<Base path for the blob API from the API Lookup Service>/layers/<Layer ID>/keys/<Object Key> HTTP/1.1
Host: <Hostname for the blob API from the API Lookup Service>
Authorization: Bearer <Authorization Token>
Cache-Control: no-cache

The response consists of the binary data that was uploaded most recently to the given object key.

Note

We recommend that your application includes retry logic for handling HTTP 5xx errors. Use exponential backoff in the retry logic.

Get Partial Data by Key

To resume download of a large response when there is a connection issue between the client and server or to fetch a specific slice of the blob, you can provide a Range header as RFC 7233, for example Range: bytes=10-.

GET /<Base path for the blob API from the API Lookup Service>/layers/<Layer ID>/keys/<Object Key> HTTP/1.1
Host: <Hostname for the blob API from the API Lookup Service>
Range: bytes=10-
Authorization: Bearer <Authorization Token>
Cache-Control: no-cache

The response will include only the byte slice you requested.

results matching ""

    No results matching ""