DCAEGEN2-1920 enhance policy plugin for error conditions
[dcaegen2/platform/plugins.git] / dcae-policy / dcaepolicy-node-type.yaml
1 # ================================================================================
2 # Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ============LICENSE_END=========================================================
16 #
17 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
18
19 plugins:
20   dcaepolicy:
21     executor: 'central_deployment_agent'
22     package_name: dcaepolicyplugin
23     package_version: 2.3.2
24
25 data_types:
26     # the properties inside dcae.data.policy_filter are identical to /getConfig API of policy-engine except the requestID field.
27     # refer to policy-engine /getConfig wiki for explanation of these properties.
28     # policy-engine /getConfig wiki: The filter works as a combined "AND" operation.
29     #                                To retrieve all policies using "sample" as configName,
30     #                                   the request needs to have policyName = ".*"  and configName as = "sample"
31     # configAttributes is a key-value dictionary or a stringified json of the dictionary
32     dcae.data.policy_filter:
33         properties:
34             policyName:
35                 type: string
36                 default: "DCAE.Config_.*"
37             configName:
38                 type: string
39                 default: ""
40             onapName:
41                 type: string
42                 default: "DCAE"
43             configAttributes:
44                 default: {}
45             unique:
46                 type: boolean
47                 default: false
48
49 node_types:
50     # node that points to a single latest policy identified by policy_id
51     #   policy_id is the versionless left part of policyName in policy-engine
52     dcae.nodes.policy:
53         derived_from: cloudify.nodes.Root
54         properties:
55             policy_id:
56                 description: versionless key to policy in policy-engine
57                 type: string
58                 default: DCAE.Config_unknown-policy
59             policy_required:
60                 description: whether to throw an exception when failed to get the policy
61                 type: boolean
62                 default: false
63         interfaces:
64             cloudify.interfaces.lifecycle:
65                 create:
66                     implementation: dcaepolicy.dcaepolicyplugin.policy_get
67
68     # node that points to varying collection of policies by selection criteria = policy_filter.
69     dcae.nodes.policies:
70         derived_from: cloudify.nodes.Root
71         properties:
72             policy_filter:
73                 type: dcae.data.policy_filter
74                 default: {}
75             policy_required:
76                 description: whether to throw an exception when failed to get a policy
77                 type: boolean
78                 default: false
79         interfaces:
80             cloudify.interfaces.lifecycle:
81                 create:
82                     implementation: dcaepolicy.dcaepolicyplugin.policy_get