The CAS Curator module exposes a RESTful API that clients can use to interact with the underlying CAS metadata catalog to inspect, add, update or delete product metadata.

Following we are listing the available endpoints, and provide examples of sample requests. All listed URLs must be pre-pended by "http://hostname:port/curator" where "hostname" and "port" are the fully qualified domain name and port where the Curator web application is deployed. We use "curl" as example client to issue HTTP requests.

  • URL: /services/metadata/catalog
    • HTTP method: GET
    • Description: retrieves the available metadata for a catalog product
    • Parameters:
      • "id": product identifier (required)
      • "format=json": to return the metadata in JSON format (optional - by default format=html i.e. the metadata is returned wrapped within an HTML table)
    • Response: text/html (default) or application/json
    • Examples:
  • URL: /services/metadata/catalog
    • HTTP method: POST
    • Description: updates or inserts metadata fields for an existing product
    • Parameters:
      • "id": product identifier (required)
      • "metadata.<field name>=<field value>": name and value of metadata field to insert or update. Product metadata fields need to be pre-pended with "metadata." to be distinguished from other HTTP control flow parameters. More than one metadata field can be specified in the same request. To add more than one value for the same field, use multiple "metadata.<field_name>=..." expressions. (optional, but must me specified for the request to be meaningful)
      • Response: text/html containing the full product metadata
    • Examples:
  • URL: /services/metadata/update
    • HTTP method: POST
    • Description: alternate endpoint (with slightly different functionality) to update one or more metadata fields for an existing product, while preserving all the other metadata fields
    • Parameters:
      • "id": product identifier (either "id" or "name" is required)
      • "name": product name (either "id" or "name" is required)
      • "metadata.<field name>=<field value>": name and value of metadata field to insert or update. Product metadata fields need to be pre-pended with "metadata." to be distinguished from other HTTP control flow parameters. More than one metadata field can be specified in the same request. To add more than one value for the same field, use multiple "metadata.<field_name>=..." expressions. (optional, but must me specified for the request to be meaningful)
      • "replace=false" to add the new value(s) to the existing ones for that metadata field (optional: by default replace=true, meaning the new value(s) will override the existing ones)
      • "remove=true" to remove an existing metadata field (optional: by default remove=false, meaning the specified values will be added to the field)
    • Response: text/plain with content of the form "id=<product id>"
    • Examples:
  • URL: /services/metadata/staging
    • HTTP method: GET
    • Description: retrieves the staging metadata (content of <product_id>.met file) of an existing product, if available
    • Parameters:
      • "id": product identifier (required)
      • "format=json": to return the metadata in JSON format (optional - by default format=html i.e. the metadata is returned wrapped within an HTML table)
    • Response: text/html (default) or application/json
    • Examples:
  • URL: /services/metadata/staging
    • HTTP method: POST
  • URL: /services/metadata/productType
    • HTTP method: GET
  • URL: /services/metadata/productType
    • HTTP method: POST
  • URL: /services/metadata/extractor/config
    • HTTP method: GET
  • URL: /services/metadata/productType/parentmap
    • HTTP method: GET
    • Description: gets the parent-child relationship among productTypes
    • Parameters:
      • "policy": the policy directory (core, geo, etc : required)
    • Response: json text
  • URL: /services/metadata/productType/parent/add
    • HTTP method: POST
    • Description: adds a product type
    • Parameters:
      • "id": product type identifier (required)
      • "parentId": parent product type identifier
      • "policy": the policy directory (core, geo, etc : required)
    • Response: boolean
  • URL: /services/metadata/productType/parent/remove
    • HTTP method: DELETE
    • Description: removes the product type parent
    • Parameters:
      • "id": product type identifier (required)
      • "policy": the policy directory (core, geo, etc : required)
    • Response: boolean
  • URL: /services/metadata/productType/elements/add
    • HTTP method: POST
    • Description: deletes the product type
    • Parameters:
      • "id": product type identifier (required)
      • "policy": the policy directory (core, geo, etc : required)
      • "elementIds": A comma separated list of element ids
    • Response: boolean
  • URL: /services/metadata/productType/elements
    • HTTP method: GET
    • Description: fetches all valid elements for a product type
    • Parameters:
      • "id": product type identifier (required)
      • "policy": the policy directory (core, geo, etc : required)
      • "direct": if false, fetch elements for children as well (required)
    • Response: elements json
  • URL: /services/metadata/productType/elements/remove/all
    • HTTP method: DELETE
    • Description: deletes all elements for a product type
    • Parameters:
      • "id": product type identifier
      • "policy": the policy directory (core, geo, etc)
    • Response: boolean
  • URL: /services/metadata/productType/elements/remove
    • HTTP method: DELETE
    • Description: deletes specified element ids for a  product type
    • Parameters:
      • "id": product type identifier
      • "policy": the policy directory (core, geo, etc)
      • "elementIds": The element ids to remove
    • Response: boolean
  • URL: /services/metadata/productType/typeswithelement/{elementId}
    • HTTP method: GET
    • Description: get product types that have the provided elementId as a valid element
    • Parameters:
      • "policy": the policy directory (core, geo, etc)
      • "elementId": the element id
    • Response: json of all type ids

 

Curator API Static Docs

There is also another, less maintained, API guide for the ingestion side of the curator, available here: http://svn.apache.org/repos/asf/oodt/site/components/maven/curator/api/index.html

  • No labels