1c07b7a5843065918dbc2588517e79d8d8d84b24
[dcaegen2/platform/plugins.git] / dcae-policy / dcaepolicy-node-type.yaml
1 # ================================================================================
2 # Copyright (c) 2017-2018 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 tosca_definitions_version: cloudify_dsl_1_3
20
21 imports:
22     - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
23
24 plugins:
25   dcaepolicy:
26     executor: 'central_deployment_agent'
27     package_name: dcaepolicyplugin
28     package_version: 2.3.0
29
30 data_types:
31     # the properties inside dcae.data.policy_filter are identical to /getConfig API of policy-engine except the requestID field.
32     # refer to policy-engine /getConfig wiki for explanation of these properties.
33     # policy-engine /getConfig wiki: The filter works as a combined "AND" operation.
34     #                                To retrieve all policies using "sample" as configName,
35     #                                   the request needs to have policyName = ".*"  and configName as = "sample"
36     # configAttributes is a key-value dictionary or a stringified json of the dictionary
37     dcae.data.policy_filter:
38         properties:
39             policyName:
40                 type: string
41                 default: "DCAE.Config_.*"
42             configName:
43                 type: string
44                 default: ""
45             onapName:
46                 type: string
47                 default: "DCAE"
48             configAttributes:
49                 default: {}
50             unique:
51                 type: boolean
52                 default: false
53
54 node_types:
55     # node that points to a single latest policy identified by policy_id
56     #   policy_id is the versionless left part of policyName in policy-engine
57     dcae.nodes.policy:
58         derived_from: cloudify.nodes.Root
59         properties:
60             policy_id:
61                 description: versionless key to policy in policy-engine
62                 type: string
63                 default: DCAE.Config_unknown-policy
64             policy_required:
65                 description: whether to throw an exception when failed to get the policy
66                 type: boolean
67                 default: false
68         interfaces:
69             cloudify.interfaces.lifecycle:
70                 create:
71                     implementation: dcaepolicy.dcaepolicyplugin.policy_get
72
73     # node that points to varying collection of policies by selection criteria = policy_filter.
74     dcae.nodes.policies:
75         derived_from: cloudify.nodes.Root
76         properties:
77             policy_filter:
78                 type: dcae.data.policy_filter
79                 default: {}
80         interfaces:
81             cloudify.interfaces.lifecycle:
82                 create:
83                     implementation: dcaepolicy.dcaepolicyplugin.policy_get