Add support for HTTPS
[dcaegen2/services/pm-mapper.git] / dpo / blueprints / k8s-pm-mapper.yaml
1 #
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2019 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19 #
20
21 tosca_definitions_version: cloudify_dsl_1_3
22
23 imports:
24   - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml"
25   - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/k8splugin/1.4.5/k8splugin_types.yaml"
26
27 inputs:
28   service_name:
29     type: string
30     description: Name of the serice
31     default: "dcae-pm-mapper"
32   tag_version:
33     type: string
34     description: Docker image to be used
35     default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:latest"
36   replicas:
37     type: integer
38     description: Number of instances
39     default: 1
40   aaf_username:
41     type: string
42     description: AAF user name
43     default: "username"
44   aaf_password:
45     type: string
46     description: AAF password
47     default: "password"
48   client_role:
49     type: string
50     description: Client role to request secure access to topic
51     default: "ves-publisher"
52   client_id:
53     type: string
54     description: Client id for given AAF client
55     default: "ves-pub-1"
56   dmaap_dr_username:
57     type: string
58     description: DMAAP Data Router user name
59     default: "username"
60   dmaap_dr_password:
61     type: string
62     description: DMAAP Data Router password
63     default: "password"
64   dcae_location:
65     type: string
66     description: DCAE location for the subscriber, used to set up routing
67     default: "location"
68   subscriber_id:
69     type: string
70     description: Subscriber id in Data Router
71     default: ""
72   pm_mapper_service_protocol:
73     type: string
74     description: PM Mapper protocol
75     default: "https"
76   pm_mapper_service_port:
77     type: string
78     description: PM Mapper host port
79     default: "8443"
80   dmaap_buscontroller_service_host:
81     type: string
82     description: DMAAP Bus Controller host address
83     default: "dmaap-bc.onap.svc.cluster.local"
84   dmaap_buscontroller_service_port:
85     type: string
86     description: DMAAP Bus Controller host port
87     default: "8080"
88   dmaap_dr_feed_id:
89     type: string
90     description: ID of the Data Router feed that the PM Mapper will subscribe to
91     default: "1"
92   dmaap_dr_service_host:
93     type: string
94     description: DMAAP Data Router host address
95     default: "dmaap-dr-node"
96   dmaap_dr_service_port:
97     type: string
98     description: DMAAP Data Router host port
99     default: "8443"
100   dmaap_mr_service_host:
101     type: string
102     description: DMAAP Message Router host address
103     default: "dmaap-mr"
104   dmaap_mr_service_port:
105     type: string
106     description: DMAAP Message Router host port
107     default: "3905"
108   dmaap_mr_topic_name:
109     type: string
110     description: Name of Message Router topic events will be published to
111     default: "pm-mapper-ves"
112   filter:
113     type: string
114     description: PM Mapper filter on measInfo, measInfoId, measType, instanceId
115     default: "{ \"filters\":[]}"
116   enable_http:
117     type: boolean
118     description: Option to turn on HTTP connections
119     default: false
120
121 node_templates:
122   pm-mapper:
123     interfaces:
124       cloudify.interfaces.lifecycle:
125         start:
126           inputs:
127             ports:
128               - '8443:0'
129               - '8081:0'
130     properties:
131       application_config:
132         enable_http:
133           { get_input: enable_http }
134         trust_store_path: "/opt/app/pm-mapper/etc/cert/trust.jks.b64"
135         trust_store_pass_path: "/opt/app/pm-mapper/etc/cert/trust.pass"
136         key_store_path: "/opt/app/pm-mapper/etc/cert/cert.jks.b64"
137         key_store_pass_path: "/opt/app/pm-mapper/etc/cert/cert.pass"
138         buscontroller_feed_subscription_endpoint:
139           { concat: ["http://", { get_input: dmaap_buscontroller_service_host },
140                      ":", { get_input: dmaap_buscontroller_service_port}, "/webapi/dr_subs"]}
141         dmaap_dr_feed_id:
142           get_input: dmaap_dr_feed_id
143         dmaap_dr_delete_endpoint:
144           { concat: ["https://", { get_input: dmaap_dr_service_host },
145                      ":", { get_input: dmaap_dr_service_port}, "/delete"]}
146         pm-mapper-filter:
147           get_input: filter
148         streams_subscribes:
149           dmaap_subscriber:
150             type:
151               "data_router"
152             dmaap_info:
153               username:
154                 get_input: dmaap_dr_username
155               password:
156                 get_input: dmaap_dr_password
157               location:
158                 get_input: dcae_location
159               subscriber_id:
160                 get_input: subscriber_id
161               delivery_url:
162                 { concat: [{ get_input: pm_mapper_service_protocol },"://", { get_input: service_name }, ".onap.svc.cluster.local",
163                            ":", { get_input: pm_mapper_service_port }, "/delivery"]}
164         streams_publishes:
165           dmaap_publisher:
166             aaf_username:
167               get_input: aaf_username
168             aaf_password:
169               get_input: aaf_password
170             type:
171               "message_router"
172             dmaap_info:
173               client_role:
174                 get_input: client_role
175               client_id:
176                 get_input: client_id
177               topic_url:
178                 { concat: ["https://", { get_input: dmaap_mr_service_host },
179                            ":", { get_input: dmaap_mr_service_port }, "/events/", { get_input: dmaap_mr_topic_name }]}
180               location:
181                 get_input: dcae_location
182       docker_config:
183         healthcheck:
184           endpoint: /healthcheck
185           interval: 15s
186           timeout: 1s
187           type: https
188       image:
189         get_input: tag_version
190       replicas: { get_input: replicas }
191       name: { get_input: service_name }
192       dns_name: { get_input: service_name }
193       log_info:
194         log_directory: "/var/log/ONAP/dcaegen2/services/pm-mapper"
195       tls_info:
196         cert_directory: "/opt/app/pm-mapper/etc/cert/"
197         use_tls: true
198     type: dcae.nodes.ContainerizedPlatformComponent