a3a070b7b14c568fe45ad6aca9a7476246f8fc02
[dcaegen2/platform/plugins.git] / dcae-policy / README.md
1 # dcae-policy plugin and node-type
2
3 - python-package dcaepolicyplugin to be used in cloudify plugins to retrieve the policy from policy-handler
4
5 ---
6
7 ## dcaepolicy node type [dcaepolicy-node-type.yaml](./dcaepolicy-node-type.yaml)
8
9 - node type for dcae.nodes.policy
10
11 - node type for dcae.nodes.policies
12
13 ---
14
15 ## discovery of policy-handler
16
17 - dcaepolicyplugin will first try finding the record of ```policy_handler``` in consul services.
18
19 - if failed, it will try finding config for "dcaepolicyplugin" in consul-kv
20
21   -- the config structure is expected to contain url to policy_handler
22   -- example of config value for key=```dcaepolicyplugin```:
23
24 ```json
25 { "dcaepolicyplugin" : { "policy_handler" : { "url" : "http://policy-handler:25577" } } }
26 ```
27
28 - if still not found, it will default to hardcoded url of ```http://policy-handler```
29
30 ---
31
32 ## Usage
33
34 import the dcaepolicy-node-type.yaml into your blueprint to use the dcae.nodes.type node
35
36 ```yaml
37 imports:
38     - https://YOUR_NEXUS_RAW_SERVER/type_files/dcaepolicy/2.3.0/node-type.yaml
39 ```
40
41 provide the value for policy_id property
42
43 ```yaml
44 node_templates:
45 ...
46   host_capacity_policy:
47     type: dcae.nodes.policy
48     properties:
49         policy_id: { get_input: host_capacity_policy_id }
50 ```
51
52 Then the dcaepolicyplugin will bring the latest policy to the dcae.nodes.policy node during the install workflow of cloudify.