4b7d227625fef5fd7ec10c6534ad20e269f38c0f
[ccsdk/cds.git] /
1 import { Parser } from './Parser';
2
3 export class VtlYMLParser implements Parser {
4     variables: Set<string> = new Set();
5     getVariables(fileContent: string): string[] {
6         if (fileContent.includes('${')) {
7             const xmlSplit = fileContent.split('${');
8             for (const val of xmlSplit) {
9                 const res = val.substring(0, val.indexOf('}'));
10                 if (res && res.length > 0) {
11                     this.variables.add(res);
12                 }
13
14             }
15         }
16         return [...this.variables];
17     }
18
19 }
20
21 /*
22
23 <vlb-business-vnf-onap-plugin xmlns="urn:opendaylight:params:xml:ns:yang:vlb-business-vnf-onap-plugin">
24     <vdns-instances>
25         <vdns-instance>
26             <ip-addr>$vdns_int_private_ip_0</ip-addr>
27             <oam-ip-addr>$vdns_onap_private_ip_0</oam-ip-addr>
28             <tag>aaaa</tag>
29             <enabled>false</enabled>
30             <tag>dddd</tag>
31         </vdns-instance>
32     </vdns-instances>
33 </vlb-business-vnf-onap-plugin>
34
35 */