Mediacentral service rest bridge toolkit
Generates platform bridge service that acts as a facade for external REST service
- Expose external REST service into the platform
- Controll the access to the API via secure gateway
- ACL vi IAM
Install the package
Install the service rest bridge toolkit from npmjs
npm i -g mediacentral-service-rest-bridge-toolkit
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
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
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.
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:
- Download proxy-bal package from https://my.avid.com/cpp/sdk/apc (Avid Platform Connector Node)
- Extract downloaded files
- Enter the extracted directory and then node_modules directory
- Extract proxy-bal.tgz file
- Rename package directory to proxy-bal
- Copy the proxy-bal directory to node_modules in service directory
- Open command line inside proxy-bal directory and type npm update