Mediacentral service starter kit

Generates platform service quick and easily.

Install the package

Install the service starter kit from npmjs

npm i -g mediacentral-service-starter-kit-nodejs

Getting started

To create your service just run the package and follow instructions. You can also create a service by passing parameters to script (use --help for more info).

.json file example with defined methods

You need to have a .json file with your service methods definitions.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"service_method_name": {
"description": "A short description",
"examples": {
"first_example": {
"paramSet": {
"name": "John"
},
"expectedResults": {
"result": "Hello John"
}
},
"second_example": {
"paramSet": {
"name": "Alice"
},
"expectedResults": {
"result": "Hello Alice"
}
},
},
"rest": {
"path": "path/to/method",
"queryParams": ["name"],
"method": "GET"
}
},
"other_method": {
"description": "A short description",
"rest": {
"path": "path/to/other",
"queryParams": ["name"],
"method": "GET"
}
},
}

Before you begin

Make sure you've opened the gateway mask on the server for development. Open this file:

/etc/sysconfig/avid-acs-gateway

And change the mask to:

export ACS_SECURITY_FULL_TRUST_IPV4_MASK_LIST="0.0.0.0/1;128.0.0.0/1"

Building rpm file

Create service .rpm file

  1. Copy service sources to your linux machine
  2. Run bash rpm-install/create-rpm-package.sh

Install created rpm

  1. Run rpm -ivh [rpm]

Service methods

  1. start - runs your service
  2. stop - stops your service
  3. restart - restarts your service
  4. status - prints service status and pid

How can I check my service output?

Your service output will be stored in /var/log/avid/[service]/log

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 (see Before you begin)

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

How to build service rpm installer

Check rpm-install/README.md