Mediacentral service rest bridge toolkit

Generates platform bridge service that acts as a facade for external REST service

Motivation:

  1. Expose external REST service into the platform
  2. Controll the access to the API via secure gateway
  3. ACL vi IAM

Install the package

Install the service rest bridge toolkit from npmjs

npm i -g mediacentral-service-rest-bridge-toolkit

Usage

Step 1 - Create or obtain the RAML file for your RESTful service

Create RAML definition for your API.

See examples in ./RamlSamples folder.

Step 2 - generate your service

To see the generatr usage help run it without parameters

mediacentral-service-rest-bridge-toolkit

or

mediacentral-service-rest-bridge-toolkit --help

To generate the service provide the path to the RAML file and output folder

mediacentral-service-rest-bridge-toolkit -r ./NetflixConductor.raml -o ./netflix-confuctor

To generate the service exposed via upstream specify the option

mediacentral-service-rest-bridge-toolkit -r ../NetflixConductor.raml -o ./netflix-confuctor -u true

Step 4 - build the docker image for your service

Build the image

docker build -t netflix-conductor:1.0 .

Step 5 - run your service

docker run --name netflix -d -t -e ACS_GATEWAY_HOST=<PLATFORM_HOST> -e BASE_URI=<SERVICE_HOST> netflix-conductor:1.0

Extensibility

Service is generated based on the serviceDefinition object created as part of RAML interpretation.

The code is generated using ejs templates. You can modify or create new teamplates according to your needs.

After service is generated you can use it as a foundation and add/change/modify the service logic.

FAQ

Why am I seeing ‘Authentication error: Client IP is not allowed either by gateway or service policy’?

You’ll need to make sure the IP mask is open on the gateway

Why am I getting ‘404 Not Found: proxy-bal’?

You’ll need to include proxy-bal module

How to include proxy-bal

Proxy-bal is package accesible only for developers with a Avid developer account
Steps include proxy-bal:

  1. Download proxy-bal package from https://my.avid.com/cpp/sdk/apc (Avid Platform Connector Node)
  2. Extract downloaded files
  3. Enter the extracted directory and then node_modules directory
  4. Extract proxy-bal.tgz file
  5. Rename package directory to proxy-bal
  6. Copy the proxy-bal directory to node_modules in service directory
  7. Open command line inside proxy-bal directory and type npm update