diff options
author | Vijay Venkatesh Kumar <vv770d@att.com> | 2021-03-01 16:10:41 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-03-01 16:10:41 +0000 |
commit | 87f19cde0f6532f5138822fa6f188b763a123235 (patch) | |
tree | c26cb918be87e45140034d8581150ba639779729 /mod/bpgenerator | |
parent | 54af880ca6fdad3034d4e12011fcaa0214a84862 (diff) | |
parent | 417f0acaf9775c863de6c23acb2869a617f85647 (diff) |
Merge "Update BPGenerator readme"
Diffstat (limited to 'mod/bpgenerator')
-rw-r--r-- | mod/bpgenerator/README.md | 78 |
1 files changed, 44 insertions, 34 deletions
diff --git a/mod/bpgenerator/README.md b/mod/bpgenerator/README.md index eb35aff..89e48c9 100644 --- a/mod/bpgenerator/README.md +++ b/mod/bpgenerator/README.md @@ -1,64 +1,74 @@ # Blueprint Generator -This tool allows the user to create a blueprint from a component spec json file +Blueprint Generator is a java-based project used to generate a cloudify blueprint yaml from a component spec json file. + +It can be used either: +- as a standalone application by directly using *onap-executable/target/blueprint-generator-onap-executable-1.7.3-SNAPSHOT.jar* +- as a Spring library # Instructions for building the tool locally - Change directory into the root directory of the project (where the pom is located) - Run the command: `mvn clean install` -- This will create a jar file and a tar file -- To execute the application +- This will create jar files +# Instructions for running BlueprintGenerator standalone: +Base command to run BlueprintGenerator: ```bash -java -jar target/blueprint-generator-1.4.0-SNAPSHOT-executable.jar +java -jar onap-executable/target/blueprint-generator-onap-executable-1.7.3-SNAPSHOT.jar app ONAP ``` - - -# Instructions for running BlueprintGenerator: - -## Instructions for running: - - --Run the program on the command line with the following tags: -OPTIONS: -- -p: The path to where the final blueprint yaml file will be created (Required) -- -i: The path to the JSON spec file (required) -- -n: Name of the blueprint (optional) -- -t: the path to the import yaml file (optional) -- -d: Onvoke the dmaap plugin (optional) -- -o: The service component name override (optional) +## Instructions for component blueprints: +Run the program on the command line with the following options: +- -i OR --component-spec: The path of the ONAP Blueprint INPUT JSON SPEC FILE (Required) +- -p OR --blueprint-path: The path of the ONAP Blueprint OUTPUT where it will be saved (Required) +- -n OR --blueprint-name: The NAME of the ONAP Blueprint OUTPUT that will be created (Optional) +- -t OR --imports: The path of the ONAP Blueprint IMPORT FILE (Optional) +- -o OR --service-name-override: The Value used to OVERRIDE the SERVICE NAME of the ONAP Blueprint (Optional) +- -d OR --dmaap-plugin: The option to create an ONAP Blueprint with DMAAP Plugin included (Optional) it will look like this: ```bash - java -jar target/<JAR Filename>.jar app ONAP -i componentspec -p OutputBlueprintPath -n Blueprintname -d +java -jar onap-executable/target/<JAR Filename>.jar app ONAP -i componentspec -p OutputBlueprintPath -n Blueprintname -d ``` This command will create a blueprint from the component spec. The blueprint file name will be called Blueprintname.yaml and it will be in the directory OutputBlueprintPath. The blueprint will also contain the DMaaP plugin. - - - - -## Extra information: -- 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 +### Extra information: +- The component spec must be of the same format as stated in the onap [readthedocs](https://docs.onap.org/projects/onap-dcaegen2/en/latest/sections/design-components/component-specification/component-type-docker.html) page - If the tag says required then the program will not run without those tags being there - If the tag says optional then it is not necessary to run the program with those tags - If you do not add a -n tag the blueprint name will default to what it is in the component spec - If the directory you specified in the -p tag does not already exist the directory will be created for you -- 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. - - -#Instructions for policy models +- The -t flag will override the default imports set for the blueprints. Below you can see example content of the import file: +```yaml +imports: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - plugin:k8splugin?version=3.6.0 + - plugin:dcaepolicyplugin?version=2.4.0 +``` --Run the program on the command line with the following tags: -OPTIONS: +## Instructions for policy models +In order to use BlueprintGenerator for policy models option: *-type policycreate* needs to be provided to the base +command. Other available options: - -i: The path to the JSON spec file (required) - -p: The output path for all of the models (required) it will look like this: ```bash - java -jar target/<JAR Filename>.jar app ONAP -type policycreate -i componentspec -p OutputPolicyPath +java -jar onap-executable/target/<JAR Filename>.jar app ONAP -type policycreate -i componentspec -p OutputPolicyPath ``` -This command will create a directory called models and put the policy models created from the component spec given in that directory. (A component spec may generate multiple policy models)
\ No newline at end of file +This command will create a directory called models and put the policy models created from the component spec given in that directory. (A component spec may generate multiple policy models) + +# Instructions for using BlueprintGenerator as a library +To use BlueprintGenerator you need to import the following artifact to your project: +```xml +<dependency> + <groupId>org.onap.dcaegen2.platform.mod</groupId> + <artifactId>blueprint-generator-onap</artifactId> + <version>1.7.3</version> +</dependency> +``` +In order to see how to use the library in detail please see file: +*bpgenerator/onap-executable/src/main/java/org/onap/blueprintgenerator/BlueprintGeneratorMainApplication.java* |