_REST_CRUD_Using
The RESTful CRUD Endpoint provides the capability to query, create, update, and delete metacards in the catalog provider as follows:
Operation | HTTP Request | Details | Example URL |
---|---|---|---|
create | HTTP POST | HTTP request body contains the input to be ingested. See InputTransformers for more information. | http://<DISTRIBUTION_HOST>:<DISTRIBUTION_PORT>/services/catalog |
update | HTTP 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. |
where <metacardId> is the Metacard.ID of the metacard to be updated |
delete | HTTP DELETE | The ID of the Metacard to be deleted is appended to the end of the URL. |
|
read | HTTP 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. |
where <metacardId> is the Metacard.ID of the metacard to be retrieved |
federated read | HTTP GET | The 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. |
where < |
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.
- 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. - Make a read request to the REST URL specifying the catalog id.
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>