Updated the documentation for dmaap plugin and policy models
[dcaegen2.git] / platformdoc / docs / components / dcae-cli / blueprint-generator / blueprint_generator.rst
1
2
3 Blueprint Generator (DCAE)
4 =============================================
5
6 What is the Blueprint Generator?
7 ++++++++++++++++++++++++++++++++
8 The blueprint generator is a java rewrite of the tosca lab python tool. The point of this tool is to be able to take a component spec for a given micro-service and translate that component spec into a blueprint yaml file that can be used during deployment.
9
10
11 Steps to run the blueprint generator:
12 +++++++++++++++++++++++++++++++++++++
13
14 1. Download the zip file from Nexus by clicking `here <https://nexus.onap.org/service/local/repositories/releases/content/org/onap/dcaegen2/platform/cli/blueprint-generator/1.2.0/blueprint-generator-1.2.0-bundle.tar.gz>`_ or "wget https://nexus.onap.org/service/local/repositories/releases/content/org/onap/dcaegen2/platform/cli/blueprint-generator/1.2.0/blueprint-generator-1.2.0-bundle.tar.gz"
15
16 2. Unzip the the tar file
17
18 3. You should see blueprint-generator-1.2.0 directory created (also a lib folder in this directory)
19
20 4. If you are in linux run the following command: "java -cp blueprint-generator/lib/blueprint-generator-1.2.0.jar:blueprint-generator/lib/* org.onap.blueprintgenerator.core.BlueprintGenerator"
21
22 5. If you are in windows run this command java -cp "lib/blueprint-generator-1.2.0.jar;lib/\*" org.onap.blueprintgenerator.core.BlueprintGenerator.
23
24 6. These commands mean that it will run java, find a path to the jar that we want to run along with all of the dependencies that we need, then you add the path to the main method. If done correctly you should see a list of all of the flags you can add. 
25
26 7. When ready you can run the program again except with the required flags.
27
28 8. OPTIONS:
29     -p: The path to where the final blueprint yaml file will be created (Required)
30
31     -i: The path to the JSON spec file (required)
32
33     -n: Name of the blueprint (optional)
34
35     -t: the path to the import yaml file (optional)
36     
37     -d: If this flag is present the bp generator will be created with dmaap plugin (optional)
38
39     -o: This flag will create a service component override for your deployment equal to the value you put (optional)
40
41 9. An example running this program in windows would look like this java -cp "lib/blueprint-generator-1.2.0.jar;lib/\*" org.onap.blueprintgenerator.core.BlueprintGenerator -p blueprint_output -i ComponentSpecs/TestComponentSpec.json -n TestAppBlueprint
42
43
44 Extra information
45 -----------------
46
47 1. The component spec must be of the same format as stated in the onap `readthedocs <https://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/sections/components/component-specification/common-specification.html#working-with-component-specs>`_ page
48
49 2. If the tag says required then the program will not run without those tags being there
50
51 3. If the tag says optional then it is not necessary to run the program with those tags
52
53 4. If you do not add a -n tag the blueprint name will default to what it is in the component spec
54
55 5. If the directory you specified in the -p tag does not already exist the directory will be created for you
56
57 6. The -t flag will override the default imports set for the blueprints. To see an example of how the import yaml file should be structured see the testImports.yaml file under the folder TestCases
58
59
60 How to create policy models:
61 +++++++++++++++++++++++++++++++++++++
62
63 1. The policy model creation is under the same zip file as the blueprint generator
64
65 2. Run the same command as the blueprint generator except replace BlueprintGenerator with PolicyCreate
66
67 3. Example command 'java -cp "lib/blueprint-generator-1.2.0.jar;lib/*" org.onap.blueprintgenerator.core.PolicyCreate'
68
69 4. Options:
70
71    -i: The path to the JSON spec file (required)
72
73    -p: The Output path for all of the models (required)
74
75 Extra information
76 -----------------
77
78 1. Not all component specs will be able to create policy models
79
80 2. Multiple policy model files may be create from a single component spec