summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 53bdcc4acde78c014718d4ba5ef77d0cc0772e61 (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# policy_handler 
## web-service for policies to be used by DCAE-Controller

- GET **/policy\_latest/***\<policy-id>* -- get the latest policy from policy-engine
- receives the **push notifications** from policy-engine through the web-socket, filters and gets the full policy-configs, and delivers that to deploy-handler

## manual http API

- GET **/catch_up** -- catch up with the latest state of the policy-engine 
- GET **/policies_latest** -- get all the latest policies in policy-engine through web-service API
- GET **/shutdown** -- shutdown the server

----------

## installation

`virtualenv policy_venv`

`cd policy_venv`

`source bin/activate`

`cd ../policy_handler`

`pip install -r requirements.txt`

----------

## preparation to run

`cd policy_venv`

`source bin/activate`

`cd ../policy_handler`

----------

## configure

in folder `policy_handler`:

    - `config.json` contains
        - `"scope_prefixes" : ["DCAE_alex.Config_"]` - the list of policy-scope-class values
        - `"policy_engine"` - the http connect info to ECOMP **policy-engine**
            - headers.ClientAuth : base64(<mech-id with namespace>:<password>)
            - headers.Authorization : base64(<policy-engine server auth>)
        - `"deploy_handler"` - the http connect info to _policy part_ of the **deploy-handler**
    - `policy_engine.properties` contains config info for the client lib of ECOMP **policy-engine** that receives push notifications from the ECOMP **policy-engine** server
        - CLIENT_ID is the mech-id with the namespace - need to register with policy-engine team thru email
        - CLIENT_KEY is the base64 of the mech-id password - separate passwords for TEST versus PROD

----------

## run

in folder `policy_handler`:

`./run_policy.sh`

----------