Coder Social home page Coder Social logo

nasa-pds / registry-api-service Goto Github PK

View Code? Open in Web Editor NEW
0.0 9.0 3.0 859 KB

(deprecated) Merged with other projects into https://github.com/NASA-PDS/registry-api

License: Other

Java 94.94% Python 1.81% HCL 3.25%
nasa-pds nasa pds-api api pds

registry-api-service's Introduction

REGISTRY-API-SERVICE

Overview

This is the PDS API implementation which provides access to the PDS registries (see https://github.com/NASA-PDS/pds-registry-app). When operational the API service will be part of the registry application. It implements a very simple collections and product search end-point complying with the specification (see https://app.swaggerhub.com/organizations/PDS_APIs).

For more information, please visit https://nasa-pds.github.io/registry-api-service/

Prerequisites

This software requires open jdk 11.

Administrator

Get the latest stable release https://github.com/NASA-PDS/registry-api-service/releases

Download the zip or tar.gz file.

Follow instructions in README.txt in the decompressed folder

Developers

Deployment

Get a development release by cloning the current repository.

If needed change server port and elasticSearch parameters in src/main/resources/application.properties. Note, the registry index in elasticSearch is hard-coded. It need to be registry.

mvn clean
mvn install
mvn spring-boot:run

๐Ÿ‘‰ Note: in order to run in this way, you will need to modify the spring-boot-starter-thymeleaf dependency by pinning it to version 1.5.1.RELEASE and excluding the logback-classic artifact in the pom.xml file as follows:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
    <version>1.5.1.RELEASE</version>
    <exclusions>
        <exclusion>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Usage

Go to rest api documentation:

http://localhost:8080/

Test the simple collection end-point:

http://localhost:8080/collections

Demo server

A demo server is deployed on https://pds-gamma.jpl.nasa.gov/api/swagger-ui.html

You can browse self documented server or you can use postman to test it.

Use postman

Postman is a tool which enable to manage collection of HTTP API requests, share and run them.

  1. Install postman desktop application https://www.postman.com/downloads/

  2. Download the latest request collection from postman collection

  3. Then you import the collection file, on the top-left: Import > File

  4. You also need to set an environment variable the base url of the demo API:

    baseUrl = https://pds-gamma.jpl.nasa.gov/api

See guidelines on https://learning.postman.com/docs/sending-requests/variables/

  1. You can browse the collection and run the requests one by one or run the full collection at once.

Docker

Prerequisite

Have a registry deployed, for example with docker as described in https://github.com/NASA-PDS/pds-registry-app/blob/main/README.md#docker

Build

Local git version

docker image build --build-arg version=$(git rev-parse HEAD) \
             --file docker/Dockerfile.local \
             --tag registry-api-service:$(git rev-parse HEAD) \
             .

Run

The /absolute/path/to/my/properties.file should be configured to access your registry's elasticsearch instance with: es:9200.

docker container run --name registry-api-service \
           --network pds \
           --publish 8080:8080 \
           --rm \
           --volume /absolute/path/to/my/properties.file:/usr/local/registry-api-service-$(git rev-parse HEAD)/src/main/resources/application.properties \
           registry-api-service:$(git rev-parse HEAD)

Develop

  1. build local git version
  2. run image as below and restart when code has changed and want to test again
docker container run --interactive \
           --name registry-api-service \
           --network pds \
           --publish 8080:8080 \
           --rm \
           --tty \
           --user $UID \
           --volume $(realpath ${PWD}):/usr/local/registry-api-service-$(git rev-parse HEAD) \
           registry-api-service:$(git rev-parse HEAD) bash
  1. Run maven as desired such as mvn spring-boot:run to run your local copy or mvn install to build it. Rinse and repeat as needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.