tree: e33a8586076fbdba57c57ef633e8d9695a5f0042 [path history] [tgz]
  1. .settings/
  2. app/
  3. conf/
  4. DBDump/
  5. logs/
  6. project/
  7. public/
  8. target/
  9. test/
  10. workflowRepository/
  11. .classpath
  12. .DS_Store
  13. .project
  14. activator
  15. activator-launch-1.2.12.jar
  16. activator-sbt-echo-akka-shim.sbt
  17. activator.bat
  18. build.sbt
  19. LICENSE
  20. NOTICE
  21. README.md
ApacheCMDA-Backend/README.md

Released under a Dual Licensing / JPL Climate Model Analysis APIs Version 1.0

JPL has provided a repository of web services for multi-aspect physics-based and phenomenon-oriented phenomenon-oriented climate model performance evaluation and diagnosis through the comprehensive and synergistic use of multiple observational data, reanalysis data, and model outputs. This Climate Model Analysis Project will help you learn the available web services, how to use them, and help you design your climate analytics workflows.

Controllers expect all non-id fields found in the entities (found in /models) Unless otherwise noted, POST = Create, PUT = Update, DELETE = Delete

Service URL:

http://einstein.sv.cmu.edu:9034/climate

Overview:

Currently we are providing APIs in 5 categores:

Category 1: Manage User

Category 2: Manage Climate Services

Category 3: Manage Service Configuration

Category 4: Manage Climate Service Parameters

Category 5: Manage Service Configuration Item

Category 6: Manage Dataset

Category 7: Manage Instrument

Detailed Usages:

Note: all TimeStamps are in Unix epoch time format to millisecond. Conversion from readable timestamp format to Unix epoch timestamp can be found in http://www.epochconverter.com

####Manage User

  1. GET USER BY ID

    • Purpose: Query a specific user using user's Id.
    • Method: GET
    • URL: /users/:id
    • Semantics:
      • id: Existing user's id.
    • Sample Usages:
      • Sample request: /users/1

      • Sample result: {“id”:1,“firstName”:“John”,“lastName”:“Watson”}

      • Result: HTTP 200 if successful, HTTP 404 if failed.

  2. ADD A USER

    • Purpose: Add a new user to the system.
    • Method: POST
    • URL: /users/add
    • Semantics: As a POST method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • firstName (string, not null): First name
      • lastName (string, not null): Last name
    • Sample Usages:
      • Sample request: {“firstName”:“John”,“lastName”:“Watson”}

      • Sample result: 1

      • Result: HTTP 201 if the new user has been successfully added to the database, with the ID of the newly created object in the response body, HTTP 400 if failed.

  3. UPDATE A USER

    • Purpose: Update a user's profile in the system.
    • Method: PUT
    • URL: /users/update/:id
    • Semantics:As a PUT method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • id: A existing user's id.
    • Sample Usages:
      • Sample request: PUT /users/update/3 {“firstName”:“Mary”}

      • Sample result: Return message “User updated”

      • Result: HTTP 201 if the user has been successfully updated, HTTP 400 if the id is wrong

  4. DELETE A USER

    • Purpose: Delete a user from the system.
    • Method: DELETE
    • URL: /users/delete/:id
    • Semantics:
      • id: Existing user id.
    • Sample Usages:
      • Sample request: /users/delete/1
      • Sample result: “User is deleted”
      • Result: HTTP 201 if the user has been successfully deleted.

####Manage Climate Services
5.GET CLIMATE SERVICE BY SERVICE NAME
- Purpose: Query for climate service using service name. If there are multiple services with the same name, all will be returned. - Method: GET - URL: /climate/getClimateService/:name/json - Semantics: - name: Existing service name. - Sample Usages: - Sample json request: /climate/getClimateService/testName/json - Sample json result: {“id”:30,“rootServiceId”:1,“user”:{“id”:31,“firstName”:“John”,“lastName”:“Watson”},“name”:“testName”,“purpose”:“For testing”,“url”:“http://einstein.sv.cmu.edu:9008/forTesting”,“scenario”:“Used only for testing”,“createTime”:“Feb 26, 2015 4:14:44 PM”,“versionNo”:“1”} - Result: HTTP 200 if returned successfully, HTTP 404 if not found.

  1. GET A CLIMATE SERVICE BY ID

    • Purpose: Query for climate service using service ID. Result will be unique.
    • Method: GET
    • URL: /climate/getClimateService/id/:id
    • Semantics:
      • id: Id of an existing service.
    • Sample Usages:
      • Sample json request: /climate/getClimateService/id/30
      • Sample json result: {“id”:30,“rootServiceId”:1,“user”:{“id”:31,“firstName”:“John”,“lastName”:“Watson”},“name”:“testName”,“purpose”:“For testing”,“url”:“http://einstein.sv.cmu.edu:9008/forTesting”,“scenario”:“Used only for testing”,“createTime”:“Feb 26, 2015 4:14:44 PM”,“versionNo”:“1”}
      • Result: HTTP 200 if returned successfully, HTTP 404 if not found.
  2. GET ALL CLIMATE SERVICE

    • Purpose: Query all climate services.

    • Method: GET

    • URL: /climate/getAllClimateServices/json

    • Semantics:

    • Sample Usages:

      • Sample json request: /climate/getAllClimateServices/json
      • Sample json result: [{“id”:33,“rootServiceId”:0,“user”:{“id”:33,“firstName”:“John”,“lastName”:“Watson”},“name”:“NightVale”,“purpose”:““,“url”:””,“scenario”:““,“createTime”:“Feb 26, 2015 4:20:31 PM”,“versionNo”:””},{“id”:34,“rootServiceId”:1,“user”:{“id”:33,“firstName”:“John”,“lastName”:“Watson”},“name”:“testName”,“purpose”:“For testing”,“url”:“http://einstein.sv.cmu.edu:9008/forTesting”,“scenario”:“Used only for testing”,“createTime”:“Feb 26, 2015 4:20:31 PM”,“versionNo”:“1”}] [{“climateServiceName”:“testName”,“purpose”:“For testing”,“url”:“http://einstein.sv.cmu.edu:9008/forTesting”,“scenario”:“Used only for testing”,“creatorId”:“admin”,“createTime”:“2014/12/18 19:37”,“versionNo”:“1”,“rootServiceId”:“1”}]
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  3. ADD A CLIMATE SERVICE

    • Purpose: Add a new climate service to the system.
    • Method: POST
    • URL: /climate/addClimateService
    • Semantics: As a POST method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • name (string, not null): Non existing unique name of the climate service

      • creatorId (string, not null): ID of the creator

      • purpose (string, optional): Purpose of the climate service

      • url (string, optional): Url linked to the configuration page of a certian climate service

      • scenario (string, optional): Scenario in which the climate service could be used

      • createTime (string, default to current time): Time the climate service is created, defaults to current time

      • versionNo (double, optional): Version number of the service

      • rootServiceId (int, optional): Root service id of the service

    • Sample Usages:
      • Command Line Example:
        1. Prepare input sensor type metadata in a json string:
          • {“creatorId”:“24”,“name”:“testName”,“purpose”:“For testing”,“url”:“http://einstein.sv.cmu.edu:9008/forTesting”,“scenario”:“Used only for testing”,“versionNo”:“1”,“rootServiceId”:“1”}
        2. curl -H “Content-Type: application/json” -d @climateService.json “http://einstein.sv.cmu.edu:9008/addClimateService
      • Result: HTTP 201 if the climate service metadata has been successfully added to the database, with the content body returning the ID of the new service as Gson formatted string. HTTP 400 if failed.
  4. UPDATE A CLIMATE SERVICE BY SERVICE ID

    • Purpose: Update a climate service using service id.
    • Method: PUT
    • URL: /climate/updateClimateService/id/:id
    • Semantics:
      • id: Existing service id.

      • name (string, not null): Non existing unique name of the climate service

      • creatorId (string, not null): ID of the creator

      • purpose (string, optional): Purpose of the climate service

      • url (string, optional): Url linked to the configuration page of a certian climate service

      • scenario (string, optional): Scenario in which the climate service could be used

      • createTime (string, default to current time): Time the climate service is created, defaults to current time

      • versionNo (double, optional): Version number of the service

      • rootServiceId (int, optional): Root service id of the service

    • Sample Usages:
      • /climate/updateClimateService/id/20
      • Result: HTTP 200 if the climate service has been successfully updated to the database.
  5. UPDATE A CLIMATE SERVICE BY SERVICE NAME

    • Purpose: Update a climate service using service name. If there are multiple, only the first climate service is changed. (The above interface is recommended)
    • Method: PUT
    • URL: /climate/updateClimateService/name/:oldName
    • Semantics:
      • oldname: Existing service name.
        • name (string, not null): New name of the climate service

        • creatorId (string, not null): ID of the creator

        • purpose (string, optional): Purpose of the climate service

        • url (string, optional): Url linked to the configuration page of a certian climate service

        • scenario (string, optional): Scenario in which the climate service could be used

        • createTime (string, default to current time): Time the climate service is created, defaults to current time

        • versionNo (double, optional): Version number of the service

        • rootServiceId (int, optional): Root service id of the service

    • Sample Usages:
  6. DELETE A CLIMATE SERVICE BY SERVICE ID

    • Purpose: Delete a service from the system.
    • Method: DELETE
    • URL: /climate/deleteClimateService/:id
    • Semantics:
      • id: Existing service id.
    • Sample Usages:
      • /climate/deleteClimateService/20
      • Result: HTTP 200 if returned successfully, HTTP 404 if not found.

####Manage Service Configuration 11.GET A SERVICE CONFIGURATION BY SERVICE CONFIGURATION ID - Purpose: Query a specific climate service configuration using service id. - Method: GET - URL: /climate/getServiceConfiguration/id/:id/json - Semantics: - id: Existing service configuration id. - Sample Usages: - /climate/getServiceConfiguration/id/1/json
- Sample json result:
{“id”:1,“climateservice”:{“id”:5,“rootServiceId”:0,“user”:{“id”:1,“firstName”:“John”,“lastName”:“Watson”},“name”:“ServiceByName”,“purpose”:“testing”,“url”:“http://einstein.sv.cmu.edu:9008/forTesting”,“scenario”:“Used for testing”,“createTime”:“Feb 26, 2015 11:20:46 AM”,“versionNo”:“1”},“user”:{“id”:1,“firstName”:“John”,“lastName”:“Watson”}}
- Result: HTTP 200 if successful, HTTP 404 if failed.

  1. GET ALL SERVICE CONFIGURATIONS CREATED BY A USER

    • Purpose: Query all service configurations created by a certain user using the user's id.
    • Method: GET
    • URL: /climate/getAllServiceConfigurationsByUserId/:userId/json
    • Semantics:
      • userId: Existing user's id.
    • Sample Usages:
      • /climate/getAllServiceConfigurationsByUserId/5/json
      • Sample json result:
        [{“id”:1,“climateservice”:{“id”:5,“rootServiceId”:0,“user”:{“id”:1,“firstName”:“John”,“lastName”:“Watson”},“name”:“ServiceByName”,“purpose”:“testing”,“url”:“http://einstein.sv.cmu.edu:9008/forTesting”,“scenario”:“Used for testing”,“createTime”:“Feb 26, 2015 11:20:46 AM”,“versionNo”:“1”},“user”:{“id”:1,“firstName”:“John”,“lastName”:“Watson”}} ......]
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  2. ADD A SERVICE CONFIGURATION

    • Purpose: Add a new service configuration to the system.
    • Method: POST
    • URL: /climate/addServiceConfiguration
    • Semantics: As a POST method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • serviceId: Existing service id.
      • userId: Existing user id.
      • runTime: The runtime of this service configuration.
    • Sample Usages:
      • Sample json request:
        {“serviceId”:2,“userId”:5,“runTime”:“01/02/2015 9:20:00”}
      • Result: HTTP 201 if the service configuration has been successfully added to the database, HTTP 400 if failed.
  3. UPDATE A SERVICE CONFIGURATION BY SERVICE CONFIGURATION ID

    • Purpose: Update a service configuration using specific service id in the system.
    • Method: PUT
    • URL: /climate/updateServiceConfiguration/id/:id
    • Semantics:
      • id: Existing service configuration id.
    • Sample Usages:
      • /climate/updateServiceConfiguration/id/1
      • Sample json request:
        {“serviceId”:2,“userId”:4,“runTime”:“01/03/2015 9:20:20”}
      • Result: HTTP 201 if the service configuration has been successfully updated, HTTP 400 if failed.
  4. DELETE A SERVICE CONFIGURATION

    • Purpose: Delete a service configuration from the system.
    • Method: DELETE
    • URL: /climate/deleteServiceConfiguration/:id
    • Semantics:
      • id: Existing service id.
    • Sample Usages:
      • /climate/deleteServiceConfiguration/1
      • Result: HTTP 200 if returned successfully, HTTP 404 if not found.

###Manage Climate Service Parameters
16.GET ALL SERVICE PARAMETERS
- Purpose: Query all service parameters. - Method: GET - URL: /parameter/getAllParameters/json - Semantics: - Sample Usages:
- Sample json request: http://einstein.sv.cmu.edu:9000/getAllServiceParameter/json - Sample json result: [{“serviceId”:“2”,“parameterDataType”:“testType”,“parameterRange”:“testrange”,“parameterEnumeration”:“number”,“parameterRule”:“rule”,“parameterPurpose”:“purpose”}] - Result: HTTP 200 if successful, HTTP 404 if failed.

  1. GET A SINGLE PARAMETER BY NAME

    • Purpose: Query a specific service parameter using name.
    • Method: GET
    • URL: /parameter/getParameter/name/:name/json
    • Semantics:
      • name: Existing parameter name.
    • Sample Usages:
      • Sample json request: http://einstein.sv.cmu.edu:9000/getAllServiceParameter/json
      • Sample json result: [{“serviceId”:“2”,“parameterDataType”:“testType”,“parameterRange”:“testrange”,“parameterEnumeration”:“number”,“parameterRule”:“rule”,“parameterPurpose”:“purpose”}]
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  2. GET A SINGLE PARAMETER BY ID

    • Purpose: Query a specific service parameter using id.
    • Method: GET
    • URL: /parameter/getParameter/id/:id/json
    • Semantics:
      • id: Existing parameter id.
    • Sample Usages:
      • Sample json request: http://einstein.sv.cmu.edu:9000/getAllServiceParameter/json
      • Sample json result: [{“serviceId”:“2”,“parameterDataType”:“testType”,“parameterRange”:“testrange”,“parameterEnumeration”:“number”,“parameterRule”:“rule”,“parameterPurpose”:“purpose”}]
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  3. ADD SERVICE PARAMETER

    • Purpose: Add a service parameter to the system.
    • Method: POST
    • URL: /parameter/addParameter
    • Semantics: As a POST method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • serviceId (int, not null): Unique id of service
      • parameterDataType (string, optional): Data Type of the parameter
      • parameterRange (string, optional): Range of the parameter
      • parameterEnumeration (string, optional): Parameter enumeration
      • parameterRule (string, optional): Parameter rule
      • parameterPurpose (string, optional): Parameter purpose
    • Sample Usages:
      • Command Line Example:
        1. Prepare input sensor type metadata in a json file:
          • “serviceParameter.json” file contains: {“serviceId”:“2”,“parameterDataType”:“testType”,“parameterRange”:“testrange”,“parameterEnumeration”:“number”,“parameterRule”:“rule”,“parameterPurpose”:“purpose”}
        2. curl -H “Content-Type: application/json” -d @executionLog.json “http://einstein.sv.cmu.edu:9008/addServiceParameter
      • Result: HTTP 201 if the climate service metadata has been successfully added to the database, HTTP 400 if failed.
  4. UPDATE A SERVICE PARAMETER BY ID

    • Purpose: Update a service parameter using id to the system.
    • Method: PUT
    • URL: /parameter/updateParameter/id/:id
    • Semantics:
      • id: Existing parameter id.
    • Sample Usages:
      • Command Line Example:
        1. Prepare input sensor type metadata in a json file:
          • “climateService.json” file contains: {“climateServiceName”: “testName”, “purpose”: “Test only”}
        2. curl -H “Content-Type: application/json” -d @climateService.json “http://einstein.sv.cmu.edu:9008/updateClimateService
      • Result: HTTP 200 if the parameter has been successfully updated to the database.
  5. UPDATE A SERVICE PARAMETER BY NAME

    • Purpose: Update a service parameter using name to the system.
    • Method: PUT
    • URL: /parameter/updateParameter/name/:oldName
    • Semantics:
      • oldName: Existing parameter name.
    • Sample Usages:
      • Command Line Example:
        1. Prepare input sensor type metadata in a json file:
          • “climateService.json” file contains: {“climateServiceName”: “testName”, “purpose”: “Test only”}
        2. curl -H “Content-Type: application/json” -d @climateService.json “http://einstein.sv.cmu.edu:9008/updateClimateService
      • Result: HTTP 200 if the parameter has been successfully updated to the database.
  6. DELETE A SERVICE PARAMTER

    • Purpose: Delete a service parameter using the name from the system.
    • Method: DELETE
    • URL: /parameter/deleteParameter/name/:name
    • Semantics:
      • name: Existing parameter id.
    • Sample Usages:
      • /parameter/deleteParameter/name/parameterName
      • Result: HTTP 200 if returned successfully, HTTP 404 if not found.

###Manage Service Configuration Item 23.GET A SERVICE CONFIGURATION ITEM BY ID - Purpose: Query a specific service configuration item using id. - Method: GET - URL: /climate/serviceConfigItemById/:id - Semantics: - id: Existing service configuration item id. - Sample Usages: - Sample request:

  - **Sample result**: 
  
  - **Result**: HTTP 200 if successful, HTTP 404 if failed.
  1. GET A SERVICE CONFIGURATION ITEM BY A SERVICE CONFIGURATION

    • Purpose: Query a specific service configuration item using one service configuration id.
    • Method: GET
    • URL: /climate/serviceConfigItemByServiceConfig/:serviceConfigId
    • Semantics:
      • serviceConfigId: Existing service configuration id.
    • Sample Usages:
      • Sample request:

      • Sample result:

      • Result: HTTP 200 if successful, HTTP 404 if failed.

  2. GET A SERVICE CONFIGURATION ITEM BY PARAMETER NAME

    • Purpose: Query a specific service configuration item using parameter name.
    • Method: GET
    • URL: /climate/serviceConfigItemByParamName/:param
    • Semantics:
      • param: Existing parameter name.
    • Sample Usages:
      • Sample request:

      • Sample result:

      • Result: HTTP 200 if successful, HTTP 404 if failed.

  3. ADD A SERVICE CONFIGURATION ITEM

    • Purpose: Add a new service configuration item to the system.
    • Method: POST
    • URL: /climate/addServiceConfigItem
    • Semantics: As a POST method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • userId:
      • serviceId:
    • Sample Usages:
      • Sample request:

      • Sample result:

      • Result: HTTP 201 if the new service configuration item has been successfully added to the database, HTTP 400 if failed.

  4. UPDATE A SERVICE CONFIGURATION ITEM BY ID

    • Purpose: Update a service configuration item in the system.
    • Method: PUT
    • URL: /climate/updateServiceConfigItem/id/:id
    • Semantics:As a PUT method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • id: Existing service configuration item id.
    • Sample Usages:
      • Sample request:

      • Sample result:

      • Result: HTTP 201 if the service configuration item has been successfully updated, HTTP 400 if the id is wrong

  5. DELETE A SERVICE CONFIGURATION ITEM

    • Purpose: Delete a service configuration item from the system.
    • Method: DELETE
    • URL: /climate/deleteServiceConfigItem/:id
    • Semantics:
      • id: Existing service configuration item id.
    • Sample Usages:

###Manage Dataset 29.GET A DATASET BY ID - Purpose: Query a specific dataset using id. - Method: GET - URL: /dataset/getDataset/id/:id/json - Semantics: - id: Existing dataset id. - Sample Usages: - Sample request: - Sample result: - Result: HTTP 200 if successful, HTTP 404 if failed.

  1. GET ALL DATASETS

    • Purpose: Query all datasets.
    • Method: GET
    • URL: /dataset/getAllDatasets/json
    • Semantics:
    • Sample Usages:
      • Sample request:
      • Sample result:
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  2. ADD A DATASET

    • Purpose: Add a new dataset to the system.
    • Method: POST
    • URL: /dataset/addDataset
    • Semantics: As a POST method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • instrumentId: Existing instrument id.
      • ServiesId: List of existing services id.
    • Sample Usages:
      • Sample request:
      • Sample result:
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  3. UPDATE A DATASET BY ID

    • Purpose: Update a dataset using dataset id.
    • Method: PUT
    • URL: /dataset/updateDataset/id/:id
    • Semantics:
    • Sample Usages:
      • Sample request:
      • Sample result:
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  4. DELETE A DATASET BY ID - Purpose: Delete a dataset using dataset id. - Method: DELETE - URL: /dataset/deleteDataset/id/:id - Semantics: - Sample Usages:

    • Sample request:
    • Sample result:
    • Result: HTTP 200 if successful, HTTP 404 if failed.

###Manage Instrument 33.GET A INSTRUMENT BY ID - Purpose: Query a specific instrument using id. - Method: GET - URL: /instrument/getInstrument/id/:id/json - Semantics: - id: Existing instrument id. - Sample Usages: - Sample request: - Sample result: - Result: HTTP 200 if successful, HTTP 404 if failed.

  1. GET ALL INSTRUMENTS

    • Purpose: Query all instruments.
    • Method: GET
    • URL: /instrument/getAllInstruments/json
    • Semantics:
    • Sample Usages:
      • Sample request:
      • Sample result:
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  2. ADD A INSTRUMENT

    • Purpose: Add a new instrument to the system.
    • Method: POST
    • URL: /instrument/addInstrument
    • Semantics: As a POST method, the API cannot be directly executed through a web browser. Instead, it may be executed through Rails, JQuery, Python, BASH, etc.
      • instrumentId: Existing instrument id.
      • ServiesId: List of existing services id.
    • Sample Usages:
      • Sample request:
      • Sample result:
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  3. UPDATE A INSTRUMENT BY ID

    • Purpose: Update a instrument using instrument id.
    • Method: PUT
    • URL: /instrument/updateInstrument/id/:id
    • Semantics:
    • Sample Usages:
      • Sample request:
      • Sample result:
      • Result: HTTP 200 if successful, HTTP 404 if failed.
  4. DELETE A INSTRUMENT BY ID

    • Purpose: Delete a instrument using instrument id.
    • Method: DELETE
    • URL: /instrument/deleteInstrument/id/:id
    • Semantics:
    • Sample Usages:
      • Sample request:
      • Sample result:
      • Result: HTTP 200 if successful, HTTP 404 if failed.