Operation

This document describes how to operate the Product Service software contained in the product-service package. The Product Service software is a web application for retrieving product files from the Storage Service data repository. The following topics can be found in this section:

Interface

The Product Service provides a REST-based interface accessible via HTTP for interacting with the service. Because the REST-based interface operates over HTTP, there are several options for interacting with the Product Service:

  • Web Browser

    Any standard web browser (e.g., Firefox, Safari, Internet Explorer, etc.) will allow interaction with the service.

  • cURL

    The cURL utility offers the most flexible means for interacting with the service. The utility comes installed on most UNIX-based platforms and is available for download for the Windows platform. The examples in the sections that follow utilize cURL to interact with the service. If cURL is not installed on the local machine but Wget is, see the Using Wget section for converting cURL commands to Wget commands.

The examples below use http://localhost:8080 as the default base URL for the service.

Retrieve Product

The Product Service provides functionality for retrieving a file or files associated with a product ingested in a Storage Service instance. The following table details the parameters available for retrieving a product:

ParameterDescription
productIDThe product identifier for the product. This is a value generated by the Storage Service upon ingestion of a product. This parameter is required.
refIndexThe reference index indicating which file to retrieve in the case where a product was ingested with multiple files. This parameter is optional and defaults to zero (meaning the first file ingested).
formatThe format to convert the file to upon retrieval, specified as a mime type. The only valid value supported in this release is application/x-zip which will return a ZIP file containing all files ingested for the product. The refIndex parameter is ignored when this parameter is utilized. This parameter is optional and defaults to the file's native format.
% curl -X GET -o product.out -v \
http://localhost:8080/cas-product/data?productID=<product-identifier>
      

Retrieve Dataset

The Product Service provides functionality for retrieving all files ingested in a Storage Service instance for a given product type. The following table details the only parameter available for retrieving a dataset:

ParameterDescription
typeIDThe identifier for the product type. This parameter is required.
% curl -X GET -o dataset.zip -v \
http://localhost:8080/cas-product/dataset?typeID=urn:pds:TransferProduct