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