NASA - National Aeronautics and Space Administration

+ NASA Homepage
+ NASA en Español
+ Contact NASA
Go
Planetary Data System - Engineering Node Banner

Operation

This section describes how to operate the Registry Service software. The following topics can be found in this section:

Service Interface

The Registry Service provides a REST-based interface accessible via HTTP for interacting with the service. Details on the REST-based interface can be found in the API section. If viewing this document in PDF form, the API section is not available. The API documentation is available from any deployed instance of the Registry Service by accessing /registry-service/docs/ from the host application server. Because the REST-based interface operates over HTTP, there are several options for interacting with the Registry Service:

  • Registry User Interface

    The registry-ui component offers a Graphical User Interface (GUI) for interacting with the service.

  • Web Browser

    Any standard web browser (e.g., Firefox, Safari, Internet Explorer, etc.) will allow interaction with the query and retrieval interfaces of 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.

The Registry Service also allows messaging (acceptance of and return of content descriptions) in the form of XML or JavaScript Object Notation (JSON). More on this in the examples below. Each PDS Node may have their own installation of the Registry Service with its own service endpoint. Because of this, the examples below use http://localhost:8080 as the generic endpoint for the service.

Publish Artifacts

The Registry Service supports a wide range of artifacts for registration with the service. In ebXML terms, artifacts are referred to as Registry Objects. The following subsections provide examples for each of the supported Registry Object types.

Products

In PDS terms, a product can be a data product, document, element definition, mission description, schema, etc. The following is an example of a product description in XML form:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<product xmlns="http://registry.pds.nasa.gov" 
  lid="1234" 
  versionId="1.0" 
  name="Product 1234 v1" 
  objectType="Product" 
  description="This is a new version test product 1234 v1" >
  <slot name="first-name">
    <value>John</value>
  </slot>
  <slot name="last-name">
    <value>Doe</value>
  </slot>
  <slot name="phone">
    <value>(818)123-4567</value>
    <value>(818)765-4321</value>
  </slot>
</product>
        

The product description above is contained in the new_product.xml file, which can be found in the /examples directory of the software distribution package. The following command registers this product with the service:

% curl -X POST -H "Content-type:application/xml" -v -d @new_product.xml \
http://localhost:8080/registry-service/registry/products
        

A successful registration with the above command would produce the following output to standard out:

* About to connect() to localhost port 8080 (#0)
*   Trying ::1... Connection refused
*   Trying fe80::1... Connection refused
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST registry-service/registry/products HTTP/1.1
> User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) ...
> Host: localhost:8080
> Accept: */*
> Content-type:application/xml
> Content-Length: 598
> 
< HTTP/1.1 201 Created
< Server: Apache-Coyote/1.1
< Location: http://localhost:8080/registry-service/registry/products/1234/1.0
< Content-Type: application/xml
< Content-Length: 0
< Date: Wed, 14 Apr 2010 20:33:32 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection #0
urn:uuid:53451c5e-1809-4799-8dd8-060672f3e0e1
        

By inspecting the HTTP Response Location Header one can see the URL to the registered product. This header is a standard way for exchanging information about a newly created resource using HTTP. The last line of the response is the global unique identifier that the service assigned to the registered product. The following example details how to publish a new version of the above product to the service:

% curl -X POST -H "Content-type:application/xml" -v -d @new_product_v2.xml \
http://localhost:8080/registry-service/registry/products/1234
        

The value of 1234 in the example above represents the logical identifier of the original published product, which must be specified in order for the service to recognize it as a new version. The following is an example of a product description in JSON form:

{"description":"This is a new version test product 5678 v1",
 "name":"Product 5678 v1",
 "objectType":"Product",
 "versionId":"1.0",
 "lid":"5678",
 "slot":[{"name":"last-name","value":["Doe"]},
         {"name":"phone","value":["(818)123-4567","(818)765-4321"]},
         {"name":"first-name","value":["Jane"]}]}
        

The product description above is contained in the json_product.txt file. The following command registers this product with the service:

% curl -X POST -H "Content-type:application/json" -v -d @json_product.txt \
http://localhost:8080/registry-service/registry/products
        

Associations

In PDS terms, an association is a relationship between two registered artifacts. The following is an example of an association description in XML form:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<association xmlns="http://registry.pds.nasa.gov"
  sourceLid="1234"
  sourceVersionId="1.0"
  targetLid="1234"
  targetVersionId="3.0"
  associationType="associatedTo"/>
        

The association description above is contained in the new_association.xml file. The following command registers this association with the service:

% curl -X POST -H "Content-type:application/xml" -v -d @new_association.xml \
http://localhost:8080/registry-service/registry/associations
        

Services

In PDS terms, a service is an electronic resource available within the system. A service can be as simple as a web site or as intricate as the Registry Service that is described in this documentation. The following is an example of a service description in XML form:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<service xmlns="http://registry.pds.nasa.gov" 
  name="PDS Service" 
  description="This is a service to test adding a service description to the registry">
  <serviceBinding
    name="PDS Main Site" 
    description="This is the PDS main web site" 
    accessURI="http://pds.jpl.nasa.gov">
    <specificationLink 
      name="HTTP Specification Link" 
      description="This is a link to the HTTP specification."
      specificationObject="urn:uuid:HTTPSpecificationDocument">
        <usageDescription>
          Use a browser to access the PDS site. The acceptable browsers are 
          listed in the usage parameters.
        </usageDescription>
        <usageParameter>Firefox</usageParameter>
        <usageParameter>Safari</usageParameter>
        <usageParameter>Internet Explorer</usageParameter>
        <usageParameter>Chrome</usageParameter>
    </specificationLink>
  </serviceBinding>
</service>
        

The service description above is contained in the new_service.xml file. The following command registers this service with the service:

% curl -X POST -H "Content-type:application/xml" -v -d @new_service.xml \
http://localhost:8080/registry-service/registry/services
        

Schemes and Nodes

In order for the above artifacts to be accepted for registration by the service, the service must be preloaded with the list of supported object types. This procedure is detailed in the Configuration portion of the Installation section. For more information on scheme and node registration see the Scheme and Node Registration section of the documentation. If viewing this document in PDF form, see the appendix for details.

Query Artifacts

Although the Registry Service does not offer an advanced query interface, it does offer interfaces for discovering and retrieving artifact descriptions. The URLs shown in the examples below will work in a web browser.

Products

The following command retrieves a paged list of registered products from the service:

% curl -X GET -H "Accept:application/xml" -v \
http://localhost:8080/registry-service/registry/products
        

The interface above accepts a number of parameters for filtering the return results. See the API section for a detailed list of the parameters. The following command retrieves the latest product with logical identifier 1234 from the service:

% curl -X GET -H "Accept:application/xml" -v \
http://localhost:8080/registry-service/registry/products/1234
        

In order to retrieve the earliest product with logical identifier 1234, append /earliest to the URL in the example above. In order to retrieve all products with logical identifier 1234, append /all to the URL in the example above. In order to retrieve a specific product with logical identifier 1234, append the version identifier (e.g., /1.0) to the URL in the example above. The following command retrieves the specific product with logical identifier 1234 and version identifier 1.0, but in JSON form:

% curl -X GET -H "Accept:application/json" -v \
http://localhost:8080/registry-service/registry/products/1234/1.0
        

The example above will not work in a browser because it is not possible to set the HTTP Accept Header via a browser, but the following command will work in a browser by encoding the return type with a suffix in the URL:

% curl -X GET -v \
http://localhost:8080/registry-service/registry/products/1234/1.0.json
        

Associations

The following command retrieves a paged list of registered associations from the service:

% curl -X GET -H "Accept:application/xml" -v \
http://localhost:8080/registry-service/registry/associations
        

The interface above accepts a number of parameters for filtering the return results. See the API section for a detailed list of the parameters. In order to retrieve a specific association, append the global unique identifier (/<guid>) for that association to the URL in the example above.

Services

The service does not yet support a general query of registered services but a specific service can be retrieved by specifying its global unique identifier as follows:

% curl -X GET -H "Accept:application/xml" -v \
http://localhost:8080/registry-service/registry/services/<guid>
        

Schemes and Nodes

The service does not yet support a general query of registered schemes but a specific scheme can be retrieved by specifying its global unique identifier as follows:

% curl -X GET -H "Accept:application/xml" -v \
http://localhost:8080/registry-service/registry/schemes/<guid>
        

In order to retrieve the only supported scheme (at this time), replace <guid> in the example above with urn:registry:ObjectType. The following command retrieves the list of nodes associated with the urn:registry:ObjectType scheme:

% curl -X GET -H "Accept:application/xml" -v \
http://localhost:8080/registry-service/registry/schemes/urn:registry:ObjectType/nodes
        

In order to retrieve a specific node, append the global unique identifier (/<guid>) for that node to the URL in the example above.

Events

The service tracks auditable events for each registered artifact including submission, approval, deprecation, etc. The service does not yet support a general query of these events but the associated events for a specific artifact can be retrieved by specifying the artifact's global unique identifier as follows:

% curl -X GET -H "Accept:application/xml" -v \
http://localhost:8080/registry-service/registry/events/<guid>
        

Update Status

When products are successfully registered with the service they are given a status of Submitted. The status for a specific product can be modified with the following command:

% curl -X POST -H "Content-type:application/xml" -v \
http://localhost:8080/registry-service/registry/products/1234/1.0/<action>
      

Valid values for <action> include approve, deprecate and undeprecate. The following diagram details the relationship of the status state with the above actions.

Status State

Delete Artifacts

The following command deletes the specific product with logical identifier 1234 and version identifier 1.0 from the service:

% curl -X DELETE -v \
http://localhost:8080/registry-service/registry/products/1234/1.0
      

The following two examples delete an association and a service, respectively, by specifying their global unique identifier:

% curl -X DELETE -v \
http://localhost:8080/registry-service/registry/associations/<guid>

% curl -X DELETE -v \
http://localhost:8080/registry-service/registry/services/<guid>
      

Ping Service

The following command details the status of the service along with registered counts by Registry Object type:

% curl -X GET -H "Content-type:application/xml" -v \
http://localhost:8080/registry-service/registry/status
      

Controlled Access

A given instance of the Registry Service may be configured to control access to specific URLs utilizing the software of the Security Service. If this is the case, the curl application can be used to obtain an authentication cookie as follows:

% curl -d "&username=<username>&password=<password>" \
http://localhost:8080/openam/identity/authenticate

token.id=AQIC5wM2LY4SfcyFAElnVTJ4ywAONCJRVy74LMgzFYbRmdI=@AAJ...
      

The Security Service will likely be hosted on a different machine than the Registry Service. The cookie returned by the above command can then be passed as follows in a POST request:

% curl -X POST ... --cookie 'iPlanetDirectoryPro="<token.id>"'
      

The example above also applies to a DELETE request.


FirstGov Logo
+ Freedom of Information Act
+ NASA 2003 Strategic Plan
+ NASA Privacy Statement, Disclaimer, and
   Accessiblity Certification

+ Copyright/Image Use Policy
NASA Logo
Curator: Emily.S.Law
Webmaster: Maryia Sauchanka-Davis
NASA Official: William Knopf
Last Updated:
+ Comments and Questions