Remove subscription through Bus Controller
[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   tag_version:
29     type: string
30     description: Docker image to be used
31     default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:latest"
32   replicas:
33     type: integer
34     description: Number of instances
35     default: 1
36   aaf_username:
37     type: string
38     description: AAF user name
39     default: "username"
40   aaf_password:
41     type: string
42     description: AAF password
43     default: "password"
44   client_role:
45     type: string
46     description: Client role to request secure access to topic
47     default: "org.onap.dmaap.mr.PM_MAPPER.pub"
48   client_id:
49     type: string
50     description: Client id for given AAF client
51     default: "ves-pub-1"
52   dmaap_dr_username:
53     type: string
54     description: DMAAP Data Router user name
55     default: "username"
56   dmaap_dr_password:
57     type: string
58     description: DMAAP Data Router password
59     default: "password"
60   dcae_location:
61     type: string
62     description: DCAE location for the subscriber, used to set up routing
63     default: "san-francisco"
64   pm_mapper_service_protocol:
65     type: string
66     description: PM Mapper protocol
67     default: "https"
68   pm_mapper_service_port:
69     type: string
70     description: PM Mapper host port
71     default: "8443"
72   dmaap_dr_service_host:
73     type: string
74     description: DMAAP Data Router host address
75     default: "dmaap-dr-node"
76   dmaap_dr_service_port:
77     type: string
78     description: DMAAP Data Router host port
79     default: "8443"
80   dmaap_mr_service_host:
81     type: string
82     description: DMAAP Message Router host address
83     default: "dmaap-mr"
84   dmaap_mr_service_port:
85     type: string
86     description: DMAAP Message Router host port
87     default: "3905"
88   filter:
89     type: string
90     description: PM Mapper filter on measInfo, measInfoId, measType, instanceId
91     default: "{ \"filters\":[]}"
92   enable_http:
93     type: boolean
94     description: Option to turn on HTTP connections
95     default: false
96
97 node_templates:
98   pm-mapper:
99     interfaces:
100       cloudify.interfaces.lifecycle:
101         start:
102           inputs:
103             ports:
104               - '8443:0'
105               - '8081:0'
106     properties:
107       application_config:
108         enable_http:
109           { get_input: enable_http }
110         trust_store_path: "/opt/app/pm-mapper/etc/cert/trust.jks.b64"
111         trust_store_pass_path: "/opt/app/pm-mapper/etc/cert/trust.pass"
112         key_store_path: "/opt/app/pm-mapper/etc/cert/cert.jks.b64"
113         key_store_pass_path: "/opt/app/pm-mapper/etc/cert/cert.pass"
114         buscontroller_feed_subscription_endpoint:
115           { concat: ["http://", { get_input: dmaap_buscontroller_service_host },
116                      ":", { get_input: dmaap_buscontroller_service_port}, "/webapi/dr_subs"]}
117         dmaap_dr_feed_id:
118           get_input: dmaap_dr_feed_id
119         dmaap_dr_feed_name: "bulk_pm_feed"
120         dmaap_dr_delete_endpoint:
121           { concat: ["https://", { get_input: dmaap_dr_service_host },
122                      ":", { get_input: dmaap_dr_service_port},"/delete"]}
123         pm-mapper-filter:
124           get_input: filter
125         streams_subscribes:
126           dmaap_subscriber:
127             type:
128               "data_router"
129             dmaap_info:
130               username:
131                 get_input: dmaap_dr_username
132               password:
133                 get_input: dmaap_dr_password
134               location:
135                 get_input: dcae_location
136               subscriber_id: "1"
137               delivery_url:
138                 { concat: [{ get_input: pm_mapper_service_protocol },"://dcae-pm-mapper:",{ get_input: pm_mapper_service_port },"/delivery"]}
139         streams_publishes:
140           dmaap_publisher:
141             aaf_username:
142               get_input: aaf_username
143             aaf_password:
144               get_input: aaf_password
145             type:
146               "message_router"
147             dmaap_info:
148               client_role:
149                 get_input: client_role
150               client_id:
151                 get_input: client_id
152               topic_url:
153                 { concat: [{ get_input: pm_mapper_service_protocol },"://",{ get_input: dmaap_mr_service_host },
154                            ":",{ get_input: dmaap_mr_service_port },"/events/PM_MAPPER"]}
155               location:
156                 get_input: dcae_location
157       docker_config:
158         healthcheck:
159           endpoint: /healthcheck
160           interval: 15s
161           timeout: 1s
162           type: https
163       image:
164         get_input: tag_version
165       replicas: { get_input: replicas }
166       name: "dcae-pm-mapper"
167       dns_name: "dcae-pm-mapper"
168       log_info:
169         log_directory: "/var/log/ONAP/dcaegen2/services/pm-mapper"
170       tls_info:
171         cert_directory: "/opt/app/pm-mapper/etc/cert/"
172         use_tls: true
173     type: dcae.nodes.ContainerizedPlatformComponent