noms-digital-studio/hub-admin

Name: hub-admin

Owner: NOMS Digital Studio

Description: REST microservice for the The Hub.

Created: 2016-12-22 14:27:47.0

Updated: 2017-09-06 14:10:23.0

Pushed: 2017-03-03 17:12:31.0

Homepage:

Size: 244

Language: Groovy

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

hub-admin

CircleCI

REST microservice for the The Hub.

This service is responsible for content metadata and media persistence.

Ministry of Justice. National Offender Management Service.

Build
adlew clean build
Run
adlew bootRun
Content upload endpoint

POST /hub-admin/content-items Multipart form endpoint that takes a 'file' and some metadata.

Examples

Request:

onse:

Status: 201 Location: http://localhost:8080/hub-admin/content-items/7a2b215c-0e2d-4631-8f02-59e3a7c7539c

ent Items list endpoint

/hub-admin/content-items<?filter=[filter]>

er is an optional query parameter, it defaults to application/pdf if not sent.

rovide a filter that returns everything use '{}' for the filter value.


filter={ 'metadata.mediaType': 'image/jpg'}

ples

est:

Response:

Note: The metadata contents are arbitrary.


contentItems:" [
  {
    "id": "588b6821aba1db4eb9d87cb3",
    "mediaUri": "aUri1",
    "filename": "hub-admin-1-pixel.png",
    "metadata": {
        "title": "aTitle1",
        "category": "aCategory1"
    }
  },
  {
    "id": "588b6821aba1db4eb9d87cb4",
    "mediaUri": "aUri2",
    "filename": "hub-admin-2-pixel.png",
    "metadata": {
        "title": "aTitle2",
        "category": "aCategory2"
    }
  }
]

Monitoring endpoint

GET /hub-admin/health

e.g.

://localhost:8080/hub-admin/health
://hub-admin.herokuapp.com/hub-admin/health
Environment variable required by the application
ODB_CONNECTION_URI - The MongoDb connection string. Defaults to mongodb://localhost:27017
 mongodb:foo:<key>==@bar.documents.azure.com:10250/?ssl=true

E_BLOB_STORE_CONNECTION_URI - The Azure blob store connection string. 
 DefaultEndpointsProtocol=http;AccountName=<account name>;AccountKey=<key>

E_BLOB_STORE_PUBLIC_URL_BASE - The base URL for items in the blob store.   
 https://<account name>.blob.core.windows.net

C_AUTH_USERNAME - basic auth username for the the service
 user

C_AUTH_PASSWORD - basic auth password for the the service
 password
Environment variable required by the functional tests

All the above variable plus the following:

ICATION_URL - The transport, host, port and context path that the application is running on. Default to http://localhost:8080/hun-admin
 https://hub-admin.herokuapp.com/hub-admin

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.