summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 9935a4e2ad45ad7406e161b7e985801b365e7f07 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# ONAP SDC-Tosca


---
---

# Introduction

ONAP SDC-Tosca is delivered as helper JAR that can be used by clients that work with SDC TOSCA CSAR files.
It parses the CSAR and returns the model object which represents the CSAR contents, through designated function calls with SDC flavour.
It uses the underlying generic JTOSCA parser.


# Compiling ONAP JTOSCA

ONAP SDC-Tosca can be compiled easily using maven command: `mvn clean install`
The result is JAR file under "target" folder

# Testing a CSAR locally
to run the parser locally you can use the MyTest Junit test to easily execute the parser on your own input.

1. to run it place your csar in **sdc-tosca\src\test\resources\csars**

2. Go to the test class located at **sdc-tosca\src\test\java\org\onap\sdc\impl\MyTest.java**

3. un comment the logic ther and update the csar name you plced in the step above:
```java
SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
ISdcCsarHelper = getCsarHelper("csars/<your csar name example my.csar>");

//example of functions
//get node type by name
List<NodeTemplate> serviceNodeTemplatesByType = fdntCsarHelper.getServiceNodeTemplatesByType("org.openecomp.nodes.ForwardingPath");
//get node type property
String target_range = fdntCsarHelper.getNodeTemplatePropertyLeafValue(serviceNodeTemplatesByType.get(0), "target_range");

```

# Adding the SDC-Tosca to you project
the SDC tosca is avilalble as a maven depandency.
to use add the folowing depandency to your POM file:
```
<dependency>
  <groupId>org.onap.sdc.sdc-tosca</groupId>
  <artifactId>sdc-tosca</artifactId>
  <version>1.4.6</version>
</dependency>
``` 


# Getting Help


##### [Mailing list](mailto:onap-sdc@lists.onap.org)



##### [JIRA](http://jira.onap.org)



##### [WIKI](https://wiki.onap.org/display/DW/Service+Design+and+Creation+%28SDC%29+Portal)

##### [TOSCA Prser AID]((https://wiki.onap.org/display/DW/Service+Design+and+Creation+%28SDC%29+Portal))



 


# Release notes

## 1.4.1

### Features:
1. **disable max conformance level validation**: until this version the parser had the definition of the max and min conformance level of the CSAR version which it supports. 
   the conformance level is generated by sdc and as a result the two had to be aligned, over wise the CSAR will fail on parsing.
   from this version the max version will no longer be checked by the parser. 
2. **Operations support**: add support for parsing the Operations in the tosca models.  

## 1.4.2

### Features:
1. **enable types validation**  from this version all types in CSAR will be verified, all used types should be properly declared in "base" yml files e.g. node.yml , data.yml etc.

## 1.4.3

### Bug fix:
1. **validation fix**  Maximum nodeTypes we allowed in CSAR file was increased from 10 to 20.

## 1.4.4

### Features:
1. **list support for get input**  until know the get input was only supported in the following format get_input \[ <list > , index ] this way was the only option for using a list typed property and retrieving its value for a use in a property  , from this release you can use get input < list> to retrieve the whole list.

      example:
      ```
      properties:
        # the property type is list
        related_networks:
          #this is now supoorted you can retrive the whole list
          get_input: port_vpg_private_0_port_related_networks
        # the property type is string
        network:
          # this will retrive a value from the list
          get_input:
          - port_vpg_private_0_port_network
          - index_value
      ```

## 1.4.5

### Features:
1. **getPropertyLeafValueByPropertyNamePathAndNodeTemplatePath API** The new Tosca Parser API resolves property value by path in the model (including nested nodes with # delimiter) and property name.

### Code change:
1. Classes FilterType.java, JToscaValidationIssueType.java, SdcTypes.java have been moved from **org.onap.sdc.tosca.parser.impl** package to **org.onap.sdc.tosca.parser.enums** package.

## 1.4.6

### Bug fix:
1. **remove use of a snapshot dependency** update jtosca dependency version from snapshot to release. 

## 1.4.7

### Bug fix:
1. **validation fix**  Null value caused to NullPointerException in validate function in DataEntity