Fix bugs and formatting issues
[dcaegen2/services/son-handler.git] / dpo / blueprints / k8s-sonhms.yaml
1  #============LICENSE_START=======================================================
2  #    son-handler
3  #   ================================================================================
4  #     Copyright (C) 2019 Wipro Limited.
5  #     ==============================================================================
6  #       Licensed under the Apache License, Version 2.0 (the "License");
7  #       you may not use this file except in compliance with the License.
8  #       You may obtain a copy of the License at
9  #    
10  #            http://www.apache.org/licenses/LICENSE-2.0
11  #    
12  #       Unless required by applicable law or agreed to in writing, software
13  #       distributed under the License is distributed on an "AS IS" BASIS,
14  #       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  #       See the License for the specific language governing permissions and
16  #       limitations under the License.
17  #       ============LICENSE_END=========================================================
18
19 tosca_definitions_version: cloudify_dsl_1_3
20 imports:
21   - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml"
22   - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/k8splugin/1.4.5/k8splugin_types.yaml
23   - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/pgaas/1.1.0/pgaas_types.yaml
24 inputs:
25   replicas:
26     type: integer
27     description: replica count for deployment
28     default: 1
29   tag_version:
30     type: string
31     description: docker image name and version
32     default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.son-handler:1.0.0"
33   pgaas_cluster_name:
34     type: string
35     description: pg cluster
36     default: "dcae-postgres.onap.svc.cluster.local"
37   database_name:
38     type: string
39     description: database name
40     default: sonhms
41   aaf_username:
42     type: string
43     description: aaf username
44   aaf_password:
45     type: string
46     description: aaf password
47   polling_interval:
48     type: integer
49     description: dmaap polling interval
50     default: 20
51   polling_timeout:
52     type: integer
53     description: dmaap polling timeout
54     default: 60
55   num_solutions:
56     type: integer
57     description: num of solutions
58     default: 5
59   min_collision:
60     type: integer
61     description: minimum no. of collisions
62     default: 5
63   min_confusion: 
64     type: integer
65     description: minimum no. of confusions
66     default: 5
67   max_clusters:
68     type: integer
69     description: maximum clusters
70     default: 5
71   bad_threshold:
72     type: integer
73     description: threshold for bad neighbors
74     default: 50
75   poor_threshold:
76     type: integer
77     description: threshold for poor neighbors
78     default: 70
79   namespace:
80     type: String
81     description: namespace
82     default: onap
83   dmaap:
84     type: string
85     description: dmaap server
86     default: message-router
87   buffer_time:
88     type: integer
89     description: buffer time
90     default: 60
91   cg:
92     type: string
93     description: consumer group
94     default: sonhms-cg
95   cid:
96     type: string
97     description: consumer id
98     default: sonhms-cid
99   config_db:
100     type: string
101     description: config db location
102   oof:
103     type: string
104     description: oof location
105   pci_optimizer:
106     type: string
107     description: pci optimizer name in oof
108     default: pci
109   log_path:
110     type: string
111     description: log location in host
112     default: /dockerdata-nfs/son-handler
113   topic00_location:
114   topic01_location:
115   topic02_location:
116   topic03_location:
117   topic00_client_role:
118   topic01_client_role:
119   topic02_client_role:
120   topic03_client_role:
121   topic00_client_id:
122   topic01_client_id:
123   topic02_client_id:
124   topic03_client_id:
125   topic00_url:
126   topic01_url:
127   topic02_url:
128   topic03_url:
129   
130 node_templates:
131   pgaasvm:
132     type: dcae.nodes.pgaas.database
133     properties: 
134       writerfqdn: { get_input: pgaas_cluster_name }
135       name: { get_input: database_name }
136       use_existing: false
137     
138   sonhms:
139     type: dcae.nodes.ContainerizedServiceComponent
140     interfaces:
141       cloudify.interfaces.lifecycle:
142         start:
143           inputs:
144             ports:
145               - "8080:0"
146             volumes:
147               - host:
148                   path: { get_input: log_path }
149                 container:
150                   bind: /home/sonhms/logs
151                   mode: rw
152     properties:
153       image:
154         get_input: tag_version
155       service_component_type: 'dcae-sonhms'
156       service_id: 'sonhms'
157       always_pull_image: true
158       replicas: {get_input: replicas}
159       docker_config:
160         healthcheck:
161           endpoint: /healthcheck
162           interval: 15s
163           timeout: 1s
164           type: http
165       application_config:
166         streams_subscribes:
167           performance_management_topic:
168             aaf_username: { get_input: aaf_username }
169             aaf_password: { get_input: aaf_password }
170             dmaap_info:
171               location: { get_input: topic00_location }
172               client_role: { get_input: topic00_client_role }
173               client_id: { get_input: topic00_client_id }
174               topic_url: { get_input: topic00_url }
175             type: message-router
176           fault_management_topic:
177             aaf_username: { get_input: aaf_username }
178             aaf_password: { get_input: aaf_password }
179             dmaap_info: 
180               location: { get_input: topic01_location }
181               client_role: { get_input: topic01_client_role }
182               client_id: { get_input: topic01_client_id }
183               topic_url: { get_input: topic01_url }
184             type: message-router
185           nbr_list_change_topic:
186             aaf_username: { get_input: aaf_username }
187             aaf_password: { get_input: aaf_password }
188             dmaap_info:
189               location: { get_input: topic02_location }
190               client_role: { get_input: topic02_client_role }
191               client_id: { get_input: topic02_client_id }
192               topic_url: { get_input: topic02_url }
193             type: message-router
194         streams_publishes:
195           CL_topic:
196             aaf_username: { get_input: aaf_username }
197             aaf_password: { get_input: aaf_password }
198             dmaap_info: 
199               location: { get_input: topic03_location }
200               client_role: { get_input: topic03_client_role }
201               client_id: { get_input: topic03_client_id }
202               topic_url: { get_input: topic03_url }
203             type: message-router
204         postgres.host: { get_attribute: [ pgaasvm, admin, host ] }
205         postgres.port: { get_attribute: [ pgaasvm, admin, port ] }
206         postgres.username: { get_attribute: [ pgaasvm, admin, user ] }
207         postgres.password: { get_attribute: [ pgaasvm, admin, password ] }
208         sonhandler.pollingInterval: { get_input: polling_interval}
209         sonhandler.pollingTimeout: { get_input: polling_timeout }
210         sonhandler.numSolutions: { get_input: num_solutions }
211         sonhandler.minCollision: { get_input: min_collision }
212         sonhandler.minConfusion: { get_input: min_confusion }
213         sonhandler.maximumClusters: { get_input: max_clusters }
214         sonhandler.badThreshold: { get_input: bad_threshold }
215         sonhandler.poorThreshold: { get_input: poor_threshold }
216         sonhandler.namespace: { get_input: namespace }
217         sonhandler.sourceId: SONHMS
218         sonhandler.dmaap.server: 
219           - { get_input: dmaap }
220         sonhandler.bufferTime: { get_input: buffer_time }
221         sonhandler.cg: { get_input: cg }
222         sonhandler.cid: { get_input: cid }
223         sonhandler.configDb.service: { get_input: config_db }
224         sonhandler.oof.service: { get_input: oof }
225         sonhandler.optimizers: 
226           - { get_input: pci_optimizer }
227         service_calls:
228           sdnr-getpnfname: []
229           sdnr-getpci: []
230           sdnr-getnbrlist: []
231           sdnr-getcelllist: []
232           oof-req: []
233           policy-req: []
234     relationships:
235       - type: cloudify.relationships.depends_on
236         target: pgaasvm
237         
238       
239       
240