Add the following attributes between "complexName" and "resourceVersion":
<xml-element java-attribute="complexName" name="complex-name" type="java.lang.String"> |
---|
Save the file, and rebuild the libraries and microservices:
here's my example file: aai_oxm_v11.xmlShould result in BUILD SUCCESS
From https://lists.onap.org/g/onap-discuss/message/11507: The html and yaml gets automatically generated when you run install but the xsd was never part of the autogenerate maven profile. |
Run GenTester, using the target dir under aai-resources:
$ cd ~/LF/AAI/graphadmin; java -DAJSC_HOME=. -DBUNDLECONFIG_DIR=src/main/resources/ -Dloader.main=org.onap.aai.schema.GenTester -Dloader.path=./src/main/resources -Dschema.ingest.file=src/main/resources/application.properties -jar target/aai-graphadmin-*.jar You should see the following output: ---- NOTE --- about to open graph (takes a little while)--------; -- loading schema into JanusGraph -- loading schema into JanusGraph -- Loading new schema elements into JanusGraph -- -- graph commit -- graph shutdown cd logs/createDBSchema/; grep 'complex-name' metrics.log 2018-12-06T04:43:18.061+0000|2018-12-06T04:43:42.960+0000|449b8583-54c1-42bf-8ada-5b75c52d7a13||main ||AAI|AAI-TOOLS|AAI|main|COMPLETE|0|||INFO||127.0.1.1|24899|localhost||org.onap.a ai.dbgen.SchemaGenerator||||||||co=DBGenTester:Creating PropertyKey: [complex-name], [String], [SINGLE] 2018-12-06T04:43:18.061+0000|2018-12-06T04:43:42.960+0000|449b8583-54c1-42bf-8ada-5b75c52d7a13||main ||AAI|AAI-TOOLS|AAI|main|COMPLETE|0|||INFO||127.0.1.1|24899|localhost||org.onap.a ai.dbgen.SchemaGenerator||||||||co=DBGenTester:Add index for PropertyKey: [complex-name] |
---|
Get an example cloud-region object, postman: Cloud-Region Example.postman_collection.json
You should see the new attributes on the example object, as highlighted in the red rectangle above
Copy and paste the example object and PUT it to persist the new attributes. Use this postman collection thru step 15
Run PUT Cloud-Region - missing attr. This will try to PUT the object without the required attribute we defined in the schema, and the response will look like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
---|
Adding a new node type. First, add the container under the top-level inventory category. Adding "newWidgets" to "Network" so the URI will be "aai/v11/network/new-widgets/new-widget/{new-widget-name}"
<java-type name="Network"> |
---|
Set up the "NewWidgets" java type:
<java-type name="NewWidgets"> |
---|
Set up the NewWidget java type:
<java-type name="NewWidget"> |
---|
Save the file, and rebuild the libraries and microservices:
here's my example file: aai_oxm_v11.xmlRun GenTester, using the target dir under aai-resources:
$ cd ~/LF/AAI/graphadmin; java -DAJSC_HOME=. -DBUNDLECONFIG_DIR=src/main/resources/ -Dloader.main=org.onap.aai.schema.GenTester -Dloader.path=./src/main/resources -Dschema.ingest.file=src/main/resources/application.properties -jar target/aai-graphadmin-*.jar You should see the following output: ---- NOTE --- about to open graph (takes a little while)--------; -- loading schema into JanusGraph -- loading schema into JanusGraph -- Loading new schema elements into JanusGraph -- -- graph commit -- graph shutdown You can check the logs to see if the graph elements were created successfully and grep for your propertycd logs/createDBSchema/; Creating PropertyKey: [new-widget-name], [String], [SINGLE] |
---|
Add a new EdgeRule, allowing an edge between the CloudRegion and NewWidget:
{ "from": "cloud-region", "to": "tenant", "label": "has", "direction": "OUT", "multiplicity": "One2Many", "contains-other-v": "${direction}", "delete-other-v": "NONE", "SVC-INFRA": "!${direction}", "prevent-delete": "${direction}" }, { "from": "cloud-region", "to": "new-widget", "label": "has", "direction": "OUT", "multiplicity": "One2Many", "contains-other-v": "NONE", "delete-other-v": "NONE", "SVC-INFRA": "NONE", "prevent-delete": "NONE" }, This means cloud-region connects to new-widget, edge label is "has", it's an OUT edge, one cloud region can have multiple edges to new-widgets, cloud-region does not contain new-widget, new-widget will not be deleted when the cloud-region connected to it is deleted, it is not SVC_INFRA type, and having an edge to a new-widget will not prevent deletion of the cloud-region. |
---|