25e86e71f6b64f587bbe491c3aab1ea37865a187
[dcaegen2/platform/plugins.git] / relationships / relationship-types.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 tosca_definitions_version: cloudify_dsl_1_3
19
20 imports:
21     - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
22
23 plugins:
24   relationships:
25     executor: 'central_deployment_agent'
26     package_name: relationshipplugin
27     package_version: 1.1.0
28
29 relationships:
30     # The relationship type here is to be used between service component nodes. What is achieved here is
31     # functionality in providing this relationship information to the service components so that they can
32     # do service discovery.
33     #
34     # This function will create/add to the rels list for components. So going from a "collector node -> analytics node"
35     # for example, this is kind of the edge and will add:
36     # 
37     # ```
38     # "collector_name:rel": ["analytics_name"]
39     # ```
40     #
41     # To the key value store.
42     #
43     dcae.relationships.component_connected_to:
44         derived_from: cloudify.relationships.connected_to
45         # These operations are for adding and removing relationships from Consul
46         # http://getcloudify.org/guide/3.1/reference-builtin-workflows.html
47         target_interfaces:
48             cloudify.interfaces.relationship_lifecycle:
49                 preconfigure:
50                     # Adds target to the source relationship list
51                     implementation: relationships.relationshipplugin.add_relationship
52                 unlink:
53                     # Removes target from the source relationship list
54                     implementation: relationships.relationshipplugin.remove_relationship
55
56     dcae.relationships.component_contained_in:
57         derived_from: cloudify.relationships.contained_in
58         target_interfaces:
59             cloudify.interfaces.relationship_lifecycle:
60                 preconfigure:
61                     implementation: relationships.relationshipplugin.forward_destination_info
62                 # TODO: Is there a need for "unlink"?
63
64     dcae.relationships.component_registered_to:
65         #Operates on a relationship A -> B and makes the following assumptions:
66         derived_from: cloudify.relationships.connected_to
67         target_interfaces:
68             cloudify.interfaces.relationship_lifecycle:
69                 preconfigure:
70                     implementation: relationships.relationshipplugin.tasks.registered_to
71                     inputs:
72                        address_to_register:
73                            type: string
74                        port_to_register:
75                            type: string
76                        name_to_register:
77                            type: string
78                 unlink:
79                     implementation: relationships.relationshipplugin.tasks.registered_to_delete
80
81
82