/
_REST_CRUD_Using

_REST_CRUD_Using

The RESTful CRUD Endpoint provides the capability to query, create, update, and delete metacards in the catalog provider as follows:

OperationHTTP RequestDetailsExample URL
createHTTP POST

HTTP request body contains the input to be ingested. See InputTransformers for more information.

http://<DISTRIBUTION_HOST>:<DISTRIBUTION_PORT>/services/catalog
updateHTTP PUT

The ID of the Metacard to be updated is appended to the end of the URL.

The updated metadata is contained in the HTTP body.

http://<DISTRIBUTION_HOST>:<DISTRIBUTION_PORT>/services/catalog/<metacardId>

where <metacardId> is the Metacard.ID of the metacard to be updated

deleteHTTP DELETEThe ID of the Metacard to be deleted is appended to the end of the URL.

http://<DISTRIBUTION_HOST>:<DISTRIBUTION_PORT>/services/catalog/<metacardId>

where <metacardId> is the Metacard.ID of the metacard to be deleted
readHTTP GET

The ID of the Metacard to be retrieved is appended to the end of the URL.

By default, the response body will include the XML representation of the Metacard.

http://<DISTRIBUTION_HOST>:<DISTRIBUTION_PORT>/services/catalog/<metacardId>

where <metacardId> is the Metacard.ID of the metacard to be retrieved

federated readHTTP GETThe SOURCE ID of a federated source is appended in the URL before the ID of the Metacard to be retrieved is appended to the end.

http://<DISTRIBUTION_HOST>:<DISTRIBUTION_PORT>/services/catalog/sources/<sourceId>/<metacardId>

where <sourceid> is the FEDERATED SOURCE ID and <metacardId> is the Metacard.ID of the Metacard to be retrieved

 

Note that for all RESTful CRUD commands only one metacard ID is supported in the URL, i.e., bulk operations are not supported.

Interacting with the REST CRUD Endpoint

Any web browser can be used to perform a REST read. Various other tools and libraries can be used to perform the other HTTP operations on the REST endpoint (e.g., soapUI, cURL, etc.)


Metacard Transforms with the REST CRUD Endpoint

The read operation can be used to retrieve metadata in different formats.

  1. Install the appropriate feature for the desired transformer. If desired transformer is already installed such as those that come out of the box (xml,html,etc), then skip this step.
  2. Make a read request to the REST URL specifying the catalog id.
  3. Add a transform query parameter to the end of the URL specifying the shortname of the transformer to be used (e.g., transform=kml).
    Example:

    http://<DISTRIBUTION_HOST>:<DISTRIBUTION_PORT>/services/catalog/<metacardId>?transform=<TRANSFORMER_ID>
    

    Transforms also work on read operations for metacards in federated sources.

    http://<DISTRIBUTION_HOST>:<DISTRIBUTION_PORT>/services/catalog/sources/<sourceId>/<metacardId>?transform=<TRANSFORMER_ID>