diff options
author | Venkata Harish K Kajur <vk250x@att.com> | 2017-05-24 14:06:58 -0400 |
---|---|---|
committer | Venkata Harish K Kajur <vk250x@att.com> | 2017-05-24 15:24:35 -0400 |
commit | 16ea5afacc6140573ff431bf5622a6c8cc07925b (patch) | |
tree | 08e217d92acaeb357c3000774f6d685910de3f3a /aai-resources | |
parent | ae69d6fd9a3b9f56dec5c6fc0f5fc1aad67a1dfd (diff) |
Pull the latest code resources internal
Remove the test that should not be in resources
Change-Id: Ic20fe3942bae3ec217933284d2b176bb8079788e
Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-resources')
77 files changed, 11168 insertions, 382 deletions
diff --git a/aai-resources/.gitignore b/aai-resources/.gitignore index cd21128..4a3cb42 100644 --- a/aai-resources/.gitignore +++ b/aai-resources/.gitignore @@ -1,7 +1,6 @@ .settings target/ **/logs/ -bundleconfig-local/etc/auth/aai-client-cert.p12 bundleconfig-local/etc/oxm src/main/aai_schema bundleconfig-local/etc/logback.xml diff --git a/aai-resources/ajsc-shared-config/etc/logback.xml b/aai-resources/ajsc-shared-config/etc/logback.xml index 4c4e774..3775b95 100644 --- a/aai-resources/ajsc-shared-config/etc/logback.xml +++ b/aai-resources/ajsc-shared-config/etc/logback.xml @@ -2,9 +2,9 @@ <contextName>${module.ajsc.namespace.name}</contextName> <jmxConfigurator /> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfAuditLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfAuditLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n|\r\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n|\r\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <filter class="ch.qos.logback.classic.filter.LevelFilter"> @@ -186,7 +186,7 @@ </fileNamePattern> </rollingPolicy> <encoder class="org.openecomp.aai.logging.EcompEncoder"> - <pattern>${eelfLogPattern}</pattern> + <pattern>${eelfMetricLogPattern}</pattern> </encoder> </appender> diff --git a/aai-resources/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-resources/bundleconfig-local/etc/appprops/aaiconfig.properties index ad651d2..be3a6f2 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/aaiconfig.properties +++ b/aai-resources/bundleconfig-local/etc/appprops/aaiconfig.properties @@ -29,9 +29,9 @@ ecm.openstack.tenantid=b0a529aba48440a39e0caf1aea9b27e3 aai.avpn.interim.laginterface=ae0 -aai.server.url.base=https://localhost:8447/aai/ -aai.server.url=https://localhost:8447/aai/v10/ -aai.global.callback.url=https://localhost:8447/aai/ +aai.server.url.base=https://localhost:8443/aai/ +aai.server.url=https://localhost:8443/aai/v10/ +aai.global.callback.url=https://localhost:8443/aai/ aai.auth.cspcookies_on=false aai.dbmodel.filename=ex5.json @@ -60,7 +60,7 @@ aai.precheck.cloudinfrastructure.complex.defaults.region=US # single primary server aai.primary.filetransfer.serverlist=ONAPserverTBD -aai.primary.filetransfer.primarycheck=echo:8447/aai/util/echo +aai.primary.filetransfer.primarycheck=echo:8443/aai/util/echo aai.primary.filetransfer.pingtimeout=5000 aai.primary.filetransfer.pingcount=5 @@ -124,3 +124,4 @@ aai.server.rebind=g # This is a fake one just for test so please ignore ecm.auth.password.x=OBF:1igd1i9a1jnb1yte1vv11vu91yt81jk71i6o1idt +aai.run.migrations=false diff --git a/aai-resources/bundleconfig-local/etc/appprops/createDBSchema-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/createDBSchema-logback.xml index 937324e..41cfb4f 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/createDBSchema-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/createDBSchema-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="createDBSchema" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/dataGrooming-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/dataGrooming-logback.xml index 966ec4c..072c6f2 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/dataGrooming-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/dataGrooming-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="dataGrooming" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/dataSnapshot-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/dataSnapshot-logback.xml index 40e729a..58cf01d 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/dataSnapshot-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/dataSnapshot-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="dataSnapshot" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/deltool-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/deltool-logback.xml index 8a138c6..6a70d4a 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/deltool-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/deltool-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="delTool" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/error.properties b/aai-resources/bundleconfig-local/etc/appprops/error.properties index 4e98d62..3baf55c 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/error.properties +++ b/aai-resources/bundleconfig-local/etc/appprops/error.properties @@ -27,6 +27,7 @@ AAI_3006=5:6:WARN:3006:404:3001:Node cannot be directly accessed for write, must AAI_3007=5:6:INFO:3007:410:3007:This version (%1) of the API is retired, please migrate to %2 AAI_3008=5:6:ERROR:3008:400:3008:URI is not encoded in UTF-8 AAI_3009=5:6:ERROR:3009:400:3002:Malformed URL +AAI_3010=5:6:ERROR:3010:400:3002:Cannot write via this URL # pol errors AAI_3100=5:1:WARN:3100:400:3100:Unsupported operation %1 AAI_3101=5:1:WARN:3101:403:3101:Attempt by client %1 to execute API %2 @@ -110,6 +111,7 @@ AAI_6142=5:4:INFO:6142:400:3000:Retrying transaction AAI_6143=5:4:INFO:6143:400:3000:Ghost vertex found AAI_6144=5:4:WARN:6144:400:3000:Cycle found in graph AAI_6145=5:4:ERROR:6145:400:3000:Cannot create a nested/containment edge via relationship +AAI_6146=5:4:ERROR:6146:400:3000:Ambiguous identity map found, use a URI instead #--- aaicsvp: 7101-7199 AAI_7101=5:4:ERROR:7101:500:3002:Unexpected error in CSV file processing @@ -160,4 +162,4 @@ AAI_9107=5:0:WARN:9107:403:3300:SSL is not provided in request, please contact a #--- aaiinstar: 9201-9299 AAI_9201=5:4:ERROR:9201:500:3002:Unable to send notification -AAI_9202=5:4:ERROR:9202:500:3002:Unable to start a thread +AAI_9202=5:4:ERROR:9202:500:3002:Unable to start a thread
\ No newline at end of file diff --git a/aai-resources/bundleconfig-local/etc/appprops/getres-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/getres-logback.xml index 3f05c17..3b14ca2 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/getres-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/getres-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="getTool" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/posttool-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/posttool-logback.xml index 5ba965f..a03713b 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/posttool-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/posttool-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="postTool" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/prov-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/prov-logback.xml index 6a280ad..3f0a7da 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/prov-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/prov-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="provTool" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/pullInvData-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/pullInvData-logback.xml index 3cab017..6691b91 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/pullInvData-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/pullInvData-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="pullInvData" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/puttool-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/puttool-logback.xml index 45fafee..8c74ae5 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/puttool-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/puttool-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="putTool" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/rshiptool-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/rshiptool-logback.xml index a10ffd1..4fe87ca 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/rshiptool-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/rshiptool-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="rshipTool" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/appprops/updtool-logback.xml b/aai-resources/bundleconfig-local/etc/appprops/updtool-logback.xml index ef6a9b2..2dd9f11 100644 --- a/aai-resources/bundleconfig-local/etc/appprops/updtool-logback.xml +++ b/aai-resources/bundleconfig-local/etc/appprops/updtool-logback.xml @@ -1,7 +1,7 @@ <configuration> <property name="logDirectory" value="${AJSC_HOME}/logs" /> - <property name="eelfLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> - <property name="eelfMetricLogPattern" value="%X{startTime}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%X{responseDescription}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%X{elapsedTime}|%X{server}|%X{clientIpAddress}|%C|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%m){'\n', '^'}%n"/> + <property name="eelfLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> + <property name="eelfMetricLogPattern" value="%ecompStartTime|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{partnerName}|%X{targetEntity}|%X{targetServiceName}|%X{statusCode}|%X{responseCode}|%replace(%replace(%X{responseDescription}){'\\|', '!'}){'\r|\n', '^'}|%X{instanceUUID}|%level|%X{severity}|%X{serverIpAddress}|%ecompElapsedTime|%X{server}|%X{clientIpAddress}|%eelfClassOfCaller|%X{unused}|%X{processKey}|%X{targetVirtualEntity}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{component}:%replace(%replace(%m){'\\|', '!'}){'\r|\n', '^'}%n"/> <appender name="updTool" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> diff --git a/aai-resources/bundleconfig-local/etc/sysprops/sys-props.properties b/aai-resources/bundleconfig-local/etc/sysprops/sys-props.properties index 8ae26b7..5365f47 100644 --- a/aai-resources/bundleconfig-local/etc/sysprops/sys-props.properties +++ b/aai-resources/bundleconfig-local/etc/sysprops/sys-props.properties @@ -1,6 +1,6 @@ #This file is used for defining AJSC system properties for different configuration schemes and is necessary for the AJSC to run properly. #The sys-props.properties file is used for running locally. The template.sys-props.properties file will be used when deployed -#to a SOA/CSI Cloud node. +#to a SOA/CSI Cloud node. #AJSC System Properties. The following properties are required for ALL AJSC services. If you are adding System Properties for your #particular service, please add them AFTER all AJSC related System Properties. diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/AddResourceVersionProp.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/AddResourceVersionProp.java new file mode 100644 index 0000000..15c9b1e --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/AddResourceVersionProp.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + + +import java.util.Iterator; +import java.util.Properties; + +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.logging.ErrorLogHelper; +import org.openecomp.aai.util.AAIConfig; +import org.openecomp.aai.util.AAIConstants; +import com.att.eelf.configuration.Configuration; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanVertex; +import org.apache.tinkerpop.gremlin.structure.Vertex; + + +public class AddResourceVersionProp { + + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + + // Set the logging file properties to be used by EELFManager + Properties props = System.getProperties(); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); + + // NOTE -- This is a one-time migration for adding the new property "resource-version" to ALL of our nodes. + // Also -- since it's a one-time thing, we just re-use AAI_SCHEMA_MOD_LOG4J_PROPS + + TitanGraph graph = null; + + System.out.println(">>> WARNING: this script affects all nodes in the database. <<<< " ); + System.out.println(">>> Processing will begin in 5 seconds (unless interrupted). <<<"); + try { + // Give them a chance to back out of this + Thread.sleep(5000); + } catch ( java.lang.InterruptedException ie) { + System.out.println( " AddResourceVersionProp script has been aborted. "); + System.exit(1); + } + + try { + AAIConfig.init(); + ErrorLogHelper.loadProperties(); + + System.out.println(" ---- NOTE --- about to open graph (takes a little while)\n"); + + graph = AAIGraph.getInstance().getGraph(); + if( graph == null ){ + String emsg = "Not able to get a graph object in AddResourceVersionProp.java\n"; + System.out.println( emsg ); + System.exit(1); + } + + + // For each node in the db -- update the "resource-version" and the last mod timestamp. + Iterable<TitanVertex> verts = null; + verts= graph.query().vertices(); + Iterator<TitanVertex> it = verts.iterator(); + int vtxCount = 0; + long unixTimeNow = System.currentTimeMillis() / 1000L; + String timeNowInSec = "" + unixTimeNow; + + while( it.hasNext() ){ + vtxCount++; + TitanVertex tmpVtx = (TitanVertex)it.next(); + tmpVtx.property( "aai-last-mod-ts", timeNowInSec ); + tmpVtx.property( "resource-version", timeNowInSec ); + } + + System.out.println("Updated data for " + vtxCount + " vertexes. Now call graph.tx().commit(). "); + graph.tx().commit(); + + } + catch (AAIException e) { + System.out.print("Threw a AAIException: \n"); + System.out.println(e.getErrorObject().toString()); + } + catch (Exception ex) { + System.out.print("Threw a regular Exception:\n"); + System.out.println(ex.getMessage()); + } + finally { + if( graph != null ){ + // Any changes that worked correctly should have already done their commits. + graph.tx().rollback(); + graph.close(); + } + + } + + + System.exit(0); + + }// End of main() + + +} + + diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/ChangePropertyCardinality.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/ChangePropertyCardinality.java new file mode 100644 index 0000000..f92cfbc --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/ChangePropertyCardinality.java @@ -0,0 +1,307 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Iterator; +import java.util.Properties; +import java.util.TimeZone; + +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.ingestModel.DbMaps; +import org.openecomp.aai.ingestModel.IngestModelMoxyOxm; +import org.openecomp.aai.logging.ErrorLogHelper; +import org.openecomp.aai.util.AAIConfig; +import org.openecomp.aai.util.AAIConstants; +import com.att.eelf.configuration.Configuration; +import com.thinkaurelius.titan.core.Cardinality; +import com.thinkaurelius.titan.core.PropertyKey; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanVertex; +import com.thinkaurelius.titan.core.schema.TitanManagement; +import org.apache.tinkerpop.gremlin.structure.Vertex; + + +public class ChangePropertyCardinality { + + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + + //public static void ChangePropertyCardinality( String[] args ) { + + // Set the logging file properties to be used by EELFManager + Properties props = System.getProperties(); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); + + // NOTE -- We're just working with properties that are used for NODES + String propName = ""; + String targetDataType = "String"; + String targetCardinality = "SET"; + String preserveDataFlag = "false"; + boolean preserveData = false; + + + String usageString = "Usage: ChangePropertyCardinality propertyName targetDataType targetCardinality preserveDataFlag \n"; + if( args.length != 4 ){ + String emsg = "Four Parameters are required. \n" + usageString; + System.out.println( emsg ); + System.exit(1); + } + else { + propName = args[0]; + targetDataType = args[1]; + targetCardinality = args[2]; + preserveDataFlag = args[3]; + } + + if( propName.equals("") ){ + String emsg = "Bad parameter - propertyName cannot be empty. \n" + usageString; + System.out.println( emsg ); + System.exit(1); + } + else if( !targetDataType.equals("String") ){ + // && !targetDataType.equals("Integer") + // && !targetDataType.equals("Long") + // && !targetDataType.equals("Boolean") ){ + // String emsg = "Unsupported targetDataType. We only support String, Integer, Long or Boolean for now.\n" + usageString; + String emsg = "Unsupported targetDataType. We only support String for now.\n" + usageString; + System.out.println( emsg ); + System.exit(1); + } + else if( !targetCardinality.equals("SET") ){ + // && !targetCardinality.equals("LIST") + // && !targetCardinality.equals("SINGLE") ){ + String emsg = "Unsupported targetCardinality. We only support SET for now.\n" + usageString; + System.out.println( emsg ); + System.exit(1); + } + else { + if( preserveDataFlag.equals("true") ){ + preserveData = true; + String emsg = "Unsupported preserveDataFlag. For now, we only support: 'false'.\n" + usageString; + System.out.println( emsg ); + System.exit(1); + } + else if (preserveDataFlag.equals("false") ){ + preserveData = false; + } + else { + String emsg = "Unsupported preserveDataFlag. We only support: 'true' or 'false'.\n" + usageString; + System.out.println( emsg ); + System.exit(1); + } + } + + String targetDataTypeStr = ""; + if( targetCardinality.equals("SINGLE") ){ + targetDataTypeStr = targetDataType; + } + else if( targetCardinality.equals("SET") ){ + targetDataTypeStr = "Set<" + targetDataType + ">"; + } + else if( targetCardinality.equals("LIST") ){ + targetDataTypeStr = "List<" + targetDataType + ">"; + } + + Class dType = null; + if(targetDataType.equals("String")){ dType = String.class; } + else if(targetDataType.equals("Integer")){ dType = Integer.class; } + else if(targetDataType.equals("Boolean")){ dType = Boolean.class; } + else if(targetDataType.equals("Character")){ dType = Character.class; } + else if(targetDataType.equals("Long")){ dType = Long.class; } + else if(targetDataType.equals("Float")){ dType = Float.class; } + else if(targetDataType.equals("Double")){ dType = Double.class; } + + System.out.println("\n>> WARNING/NOTE - If the passed cardinality is not in synch with what is in the ex5.json file, "); + System.out.println("\n>> then this will cause problems when new environments are created."); + + // Give a big warning if the DbMaps.PropertyDataTypeMap value does not agree with what we're doing + DbMaps dbMaps = null; + try { + dbMaps = IngestModelMoxyOxm.dbMapsContainer.get(AAIConfig.get(AAIConstants.AAI_DEFAULT_API_VERSION_PROP)); + } + catch( AAIException ae ){ + String emsg = "Could not instantiate a copy of dbMaps. "; + System.out.println( emsg ); + System.exit(1); + } + + String warningMsg = ""; + if( !dbMaps.PropertyDataTypeMap.containsKey(propName) ){ + String emsg = "Property Name = [" + propName + "] not found in PropertyDataTypeMap. "; + System.out.println( emsg ); + System.exit(1); + } + else { + String currentDataType = dbMaps.PropertyDataTypeMap.get(propName); + if( !currentDataType.equals(targetDataTypeStr) ){ + warningMsg = "TargetDataType [" + targetDataTypeStr + "] does not match what is in DbMaps (" + currentDataType + ")."; + } + } + + if( !warningMsg.equals("") ){ + System.out.println("\n>>> WARNING <<<< " ); + System.out.println(">>> " + warningMsg + " <<<"); + System.out.println(">>> !!! WARNING -- this change may be overwritten in some environments if <<<"); + System.out.println(">>> !!! entries are out of synch with what is done with this script. <<<"); + System.out.println(">>> WARNING <<<< " ); + } + + System.out.println(">>> Processing will begin in 5 seconds (unless interrupted). <<<"); + try { + // Give them a chance to back out of this + Thread.sleep(5000); + } catch ( java.lang.InterruptedException ie) { + System.out.println( " DB Schema Update has been aborted. "); + System.exit(1); + } + + TitanManagement graphMgt = null; + TitanGraph graph = null; + try { + AAIConfig.init(); + ErrorLogHelper.loadProperties(); + + System.out.println(" ---- NOTE --- about to open graph (takes a little while)\n"); + + graph = AAIGraph.getInstance().getGraph(); + if( graph == null ){ + String emsg = "Not able to get a graph object in ChangePropertyCardinality.java\n"; + System.out.println( emsg ); + System.exit(1); + } + + // Make sure this property is in the DB. + graphMgt = graph.openManagement(); + if( graphMgt == null ){ + String emsg = "Not able to get a graph Management object in ChangePropertyCardinality.java\n"; + System.out.println( emsg ); + System.exit(1); + } + + PropertyKey origPropKey = graphMgt.getPropertyKey(propName); + if( origPropKey == null ){ + // The old one wasn't there, so there's nothing to do + String emsg = "The propName = [" + propName + "] is not defined in our graph. "; + System.out.println( emsg ); + System.exit(1); + } + + if( origPropKey.cardinality().equals(Cardinality.valueOf(targetCardinality)) ){ + // The existing one already has cardinality of what they're asking for. + String emsg = "The propName = [" + propName + "] already has Cardinality of [" + targetCardinality + "]. "; + System.out.println( emsg ); + System.exit(0); + } + + // Rename this property to a backup name (old name with "retired_" appended plus a dateStr) + SimpleDateFormat d = new SimpleDateFormat("MMddHHmm"); + d.setTimeZone(TimeZone.getTimeZone("GMT")); + String dteStr = d.format(new Date()).toString(); + String retiredName = propName + "-" + dteStr + "-RETIRED"; + graphMgt.changeName( origPropKey, retiredName ); + + // Create a new property using the original property name and the targetDataType + PropertyKey freshPropKey = graphMgt.makePropertyKey(propName).dataType(dType).cardinality(Cardinality.valueOf(targetCardinality)).make(); + + System.out.println("Committing schema changes with graphMgt.tx().commit()"); + graphMgt.commit(); + graph.tx().commit(); + graph.close(); + + + // Get A new graph object + System.out.println(" ---- NOTE --- about to open a second graph object (takes a little while)\n"); + + graph = AAIGraph.getInstance().getGraph(); + if( graph == null ){ + String emsg = "Not able to get a graph object in SchemaMod.java\n"; + System.out.println( emsg ); + System.exit(1); + } + + // For each node that has this property, update the new from the old and then remove the + // old property from that node + // ---- NOTE ---- We're not preserving data at this point + Iterable<TitanVertex> verts = null; + verts= graph.query().has(retiredName).vertices(); + Iterator<TitanVertex> it = verts.iterator(); + int vtxCount = 0; + while( it.hasNext() ){ + vtxCount++; + TitanVertex tmpVtx = (TitanVertex)it.next(); + String tmpVid = tmpVtx.id().toString(); + + Object origVal = tmpVtx.property(retiredName).orElse(null); + if( preserveData ){ + tmpVtx.property(propName,origVal); + System.out.println("INFO -- just did the add of the freshPropertyKey and updated it with the orig value (" + + origVal.toString() + ")"); + } + else { + // existing nodes just won't have this property anymore + // + } + tmpVtx.property(retiredName).remove(); + System.out.println("INFO -- just did the remove of the " + retiredName + " from this vertex. (vid=" + tmpVid + ")"); + } + + System.out.println("Updated data for " + vtxCount + " vertexes. Now call graph.tx().commit(). "); + graph.tx().commit(); + + } + catch (AAIException e) { + System.out.print("Threw a AAIException: \n"); + System.out.println(e.getErrorObject().toString()); + } + catch (Exception ex) { + System.out.print("Threw a regular Exception:\n"); + System.out.println(ex.getMessage()); + } + finally { + if( graphMgt != null && graphMgt.isOpen() ){ + // Any changes that worked correctly should have already done their commits. + graphMgt.rollback(); + } + if( graph != null ){ + // Any changes that worked correctly should have already done their commits. + graph.tx().rollback(); + graph.close(); + } + + } + + System.exit(0); + + }// End of main() + + +} + + diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java index 68bebc2..d03a5e3 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/DataSnapshot.java @@ -277,4 +277,4 @@ public class DataSnapshot { }// End of main() -} +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/ForceDeleteTool.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/ForceDeleteTool.java new file mode 100644 index 0000000..20d5c9f --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/ForceDeleteTool.java @@ -0,0 +1,722 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Properties; +import java.util.Scanner; +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; +import org.slf4j.MDC; + +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.util.AAIConfig; +import org.openecomp.aai.util.AAIConstants; +import com.att.eelf.configuration.Configuration; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.thinkaurelius.titan.core.TitanEdge; +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanGraphQuery; +import com.thinkaurelius.titan.core.TitanVertex; + + + +public class ForceDeleteTool { + + + private static final int MAXDESCENDENTDEPTH = 15; + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + + //SWGK 01/21/2016 - To suppress the warning message when the tool is run from the Terminal. + + // Set the logging file properties to be used by EELFManager + Properties props = System.getProperties(); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, "forceDelete-logback.xml"); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); + EELFLogger logger = EELFManager.getInstance().getLogger(ForceDeleteTool.class.getSimpleName()); + MDC.put("logFilenameAppender", ForceDeleteTool.class.getSimpleName()); + + String actionVal = ""; + String userIdVal = ""; + String dataString = ""; + Boolean displayAllVidsFlag = false; // Note - This should rarely be needed + Boolean overRideProtection = false; // This should rarely be used - it overrides all our new checking + long vertexIdLong = 0; + String edgeIdStr = ""; + String argStr4Msg = ""; + + if (args != null && args.length > 0) { + // They passed some arguments in that will affect processing + for (int i = 0; i < args.length; i++) { + String thisArg = args[i]; + argStr4Msg = argStr4Msg + " " + thisArg; + + if (thisArg.equals("-action")) { + i++; + if (i >= args.length) { + logger.error(" No value passed with -action option. "); + System.exit(0); + } + actionVal = args[i]; + argStr4Msg = argStr4Msg + " " + actionVal; + } + else if (thisArg.equals("-userId")) { + i++; + if (i >= args.length) { + logger.error(" No value passed with -userId option. "); + System.exit(0); + } + userIdVal = args[i]; + argStr4Msg = argStr4Msg + " " + userIdVal; + } + else if (thisArg.equals("-overRideProtection")) { + overRideProtection = true; + } + else if (thisArg.equals("-DISPLAY_ALL_VIDS")) { + displayAllVidsFlag = true; + } + else if (thisArg.equals("-vertexId")) { + i++; + if (i >= args.length) { + logger.error(" No value passed with -vertexId option. "); + System.exit(0); + } + String nextArg = args[i]; + argStr4Msg = argStr4Msg + " " + nextArg; + try { + vertexIdLong = Long.parseLong(nextArg); + } catch (Exception e) { + logger.error("Bad value passed with -vertexId option: [" + + nextArg + "]"); + System.exit(0); + } + } + else if (thisArg.equals("-params4Collect")) { + i++; + if (i >= args.length) { + logger.error(" No value passed with -params4Collect option. "); + System.exit(0); + } + dataString = args[i]; + argStr4Msg = argStr4Msg + " " + dataString; + } + else if (thisArg.equals("-edgeId")) { + i++; + if (i >= args.length) { + logger.error(" No value passed with -edgeId option. "); + System.exit(0); + } + String nextArg = args[i]; + argStr4Msg = argStr4Msg + " " + nextArg; + edgeIdStr = nextArg; + } + else { + logger.error(" Unrecognized argument passed to ForceDeleteTool: [" + + thisArg + "]. "); + logger.error(" Valid values are: -action -userId -vertexId -edgeId -overRideProtection -params4Collect -DISPLAY_ALL_VIDS"); + System.exit(0); + } + } + } + + if( !actionVal.equals("COLLECT_DATA") && !actionVal.equals("DELETE_NODE") && !actionVal.equals("DELETE_EDGE")){ + String emsg = "Bad action parameter [" + actionVal + "] passed to ForceDeleteTool(). Valid values = COLLECT_DATA or DELETE_NODE or DELETE_EDGE\n"; + System.out.println(emsg); + logger.error(emsg); + System.exit(0); + } + + if( actionVal.equals("DELETE_NODE") && vertexIdLong == 0 ){ + String emsg = "ERROR: No vertex ID passed on DELETE_NODE request. \n"; + System.out.println(emsg); + logger.error(emsg); + System.exit(0); + } + else if( actionVal.equals("DELETE_EDGE") && edgeIdStr.equals("")){ + String emsg = "ERROR: No edge ID passed on DELETE_EDGE request. \n"; + System.out.println(emsg); + logger.error(emsg); + System.exit(0); + } + + + userIdVal = userIdVal.trim(); + if( (userIdVal.length() < 6) || userIdVal.toUpperCase().equals("AAIADMIN") ){ + String emsg = "Bad userId parameter [" + userIdVal + "] passed to ForceDeleteTool(). must be not empty and not aaiadmin \n"; + System.out.println(emsg); + logger.error(emsg); + System.exit(0); + } + + String msg = ""; + TitanGraph graph = null; + try { + AAIConfig.init(); + System.out.println(" ---- NOTE --- about to open graph (takes a little while)--------\n"); + graph = TitanFactory.open(AAIConstants.REALTIME_DB_CONFIG); + if( graph == null ){ + String emsg = "could not get graph object in ForceDeleteTool() \n"; + System.out.println(emsg); + logger.error(emsg); + System.exit(0); + } + } + catch (AAIException e1) { + msg = e1.getErrorObject().toString(); + System.out.println(msg); + logger.error(msg); + System.exit(0); + } + catch (Exception e2) { + msg = e2.toString(); + System.out.println(msg); + logger.error(msg); + System.exit(0); + } + + msg = "ForceDelete called by: userId [" + userIdVal + "] with these params: [" + argStr4Msg + "]"; + System.out.println(msg); + logger.info(msg); + + + if( actionVal.equals("COLLECT_DATA") ){ + // When doing COLLECT_DATA, we expect the dataString string to be comma separated + // name value pairs like this: + // "propName1|propVal1,propName2|propVal2" etc. We will look for a node or nodes + // that have properties that ALL match what was passed in. + + int resCount = 0; + int firstPipeLoc = dataString.indexOf("|"); + if( firstPipeLoc <= 0 ){ + msg = "Must use the -params4Collect option when collecting data with data string in a format like: 'propName1|propVal1,propName2|propVal2'"; + System.out.println(msg); + logger.error(msg); + System.exit(0); + } + TitanGraphQuery tgQ = graph.query(); + String qStringForMsg = " graph.query()"; + // Note - if they're only passing on parameter, there won't be any commas + String [] paramArr = dataString.split(","); + for( int i = 0; i < paramArr.length; i++ ){ + int pipeLoc = paramArr[i].indexOf("|"); + if( pipeLoc <= 0 ){ + msg = "Must use the -params4Collect option when collecting data with data string in a format like: 'propName1|propVal1,propName2|propVal2'"; + System.out.println(msg); + logger.error(msg); + System.exit(0); + } + else { + String propName = paramArr[i].substring(0,pipeLoc); + String propVal = paramArr[i].substring(pipeLoc + 1); + tgQ = tgQ.has(propName,propVal); + qStringForMsg = qStringForMsg + ".has(" + propName + "," + propVal + ")"; + } + } + if( (tgQ != null) && (tgQ instanceof TitanGraphQuery) ){ + Iterable <TitanVertex> verts = (Iterable<TitanVertex>) tgQ.vertices(); + Iterator <TitanVertex> vertItor = verts.iterator(); + while( vertItor.hasNext() ){ + resCount++; + TitanVertex v = (TitanVertex)vertItor.next(); + showNodeInfo( logger, v, displayAllVidsFlag ); + int descendantCount = countDescendants( logger, v, 0 ); + String infMsg = " Found " + descendantCount + " descendant nodes \n"; + System.out.println( infMsg ); + logger.info( infMsg ); + } + } + else { + msg = "Bad TitanGraphQuery object. "; + System.out.println(msg); + logger.error(msg); + System.exit(0); + } + + String infMsg = "\n\n Found: " + resCount + " nodes for this query: [" + qStringForMsg + "]\n"; + System.out.println( infMsg ); + logger.info( infMsg ); + } + else if( actionVal.equals("DELETE_NODE") ){ + Iterator <Vertex> vtxItr = graph.vertices( vertexIdLong ); + if( vtxItr != null && vtxItr.hasNext() ) { + Vertex vtx = vtxItr.next(); + showNodeInfo( logger, vtx, displayAllVidsFlag ); + int descendantCount = countDescendants( logger, (TitanVertex)vtx, 0 ); + String infMsg = " Found " + descendantCount + " descendant nodes. Note - forceDelete does not cascade to " + + " child nodes, but they may become unreachable after the delete. \n"; + System.out.println( infMsg ); + logger.info( infMsg ); + + int edgeCount = countEdges( logger, vtx ); + + infMsg = " Found total of " + edgeCount + " edges incident on this node. \n"; + System.out.println( infMsg ); + logger.info( infMsg ); + + if( getNodeDelConfirmation(logger, userIdVal, vtx, descendantCount, edgeCount, overRideProtection) ){ + vtx.remove(); + graph.tx().commit(); + infMsg = ">>>>>>>>>> Removed node with vertexId = " + vertexIdLong; + logger.info( infMsg ); + System.out.println(infMsg); + } + else { + infMsg = " Delete Cancelled. "; + System.out.println(infMsg); + logger.info( infMsg ); + } + } + else { + String infMsg = ">>>>>>>>>> Vertex with vertexId = " + vertexIdLong + " not found."; + System.out.println( infMsg ); + logger.info( infMsg ); + } + } + else if( actionVal.equals("DELETE_EDGE") ){ + TitanEdge thisEdge = null; + Iterator <Edge> edItr = graph.edges( edgeIdStr ); + if( edItr != null && edItr.hasNext() ) { + thisEdge = (TitanEdge)edItr.next(); + } + + if( thisEdge == null ){ + String infMsg = ">>>>>>>>>> Edge with edgeId = " + edgeIdStr + " not found."; + logger.info( infMsg ); + System.out.println(infMsg); + System.exit(0); + } + + if( getEdgeDelConfirmation(logger, userIdVal, thisEdge, overRideProtection) ){ + thisEdge.remove(); + graph.tx().commit(); + String infMsg = ">>>>>>>>>> Removed edge with edgeId = " + edgeIdStr; + logger.info( infMsg ); + System.out.println(infMsg); + } + else { + String infMsg = " Delete Cancelled. "; + System.out.println(infMsg); + logger.info( infMsg ); + } + System.exit(0); + } + else { + String emsg = "Unknown action parameter [" + actionVal + "] passed to ForceDeleteTool(). Valid values = COLLECT_DATA, DELETE_NODE or DELETE_EDGE \n"; + System.out.println(emsg); + logger.info( emsg ); + System.exit(0); + } + + System.exit(0); + + }// end of main() + + + public static void showNodeInfo(EELFLogger logger, Vertex tVert, Boolean displayAllVidsFlag ){ + + try { + Iterator<VertexProperty<Object>> pI = tVert.properties(); + String infStr = ">>> Found Vertex with VertexId = " + tVert.id() + ", properties: "; + System.out.println( infStr ); + logger.info(infStr); + while( pI.hasNext() ){ + VertexProperty<Object> tp = pI.next(); + infStr = " [" + tp.key() + "|" + tp.value() + "] "; + System.out.println( infStr ); + logger.info(infStr); + } + + ArrayList <String> retArr = collectEdgeInfoForNode( logger, tVert, displayAllVidsFlag ); + for( String infoStr : retArr ){ + System.out.println( infoStr ); + logger.info(infoStr); + } + } + catch (Exception e){ + String warnMsg = " -- Error -- trying to display edge info. [" + e.getMessage() + "]"; + System.out.println( warnMsg ); + logger.warn(warnMsg); + } + + }// End of showNodeInfo() + + + public static void showPropertiesForEdge( EELFLogger logger, TitanEdge tEd ){ + String infMsg = ""; + if( tEd == null ){ + infMsg = "null Edge object passed to showPropertiesForEdge()"; + System.out.print(infMsg); + logger.info(infMsg); + return; + } + + // Try to show the edge properties + try { + infMsg =" Label for this Edge = [" + tEd.label() + "] "; + System.out.print(infMsg); + logger.info(infMsg); + + infMsg =" EDGE Properties for edgeId = " + tEd.id() + ": "; + System.out.print(infMsg); + logger.info(infMsg); + Iterator <String> pI = tEd.keys().iterator(); + while( pI.hasNext() ){ + String propKey = pI.next(); + infMsg = "Prop: [" + propKey + "], val = [" + + tEd.property(propKey) + "] "; + System.out.print(infMsg); + logger.info(infMsg); + } + } + catch( Exception ex ){ + infMsg = " Could not retrieve properties for this edge. exMsg = [" + + ex.getMessage() + "] "; + System.out.println( infMsg ); + logger.info(infMsg); + } + + // Try to show what's connected to the IN side of this Edge + try { + infMsg = " Looking for the Vertex on the IN side of the edge: "; + System.out.print(infMsg); + logger.info(infMsg); + TitanVertex inVtx = tEd.inVertex(); + Iterator<VertexProperty<Object>> pI = inVtx.properties(); + String infStr = ">>> Found Vertex with VertexId = " + inVtx.id() + + ", properties: "; + System.out.println( infStr ); + logger.info(infStr); + while( pI.hasNext() ){ + VertexProperty<Object> tp = pI.next(); + infStr = " [" + tp.key() + "|" + tp.value() + "] "; + System.out.println( infStr ); + logger.info(infStr); + } + } + catch( Exception ex ){ + infMsg = " Could not retrieve vertex data for the IN side of " + + "the edge. exMsg = [" + ex.getMessage() + "] "; + System.out.println( infMsg ); + logger.info(infMsg); + } + + // Try to show what's connected to the OUT side of this Edge + try { + infMsg = " Looking for the Vertex on the OUT side of the edge: "; + System.out.print(infMsg); + logger.info(infMsg); + TitanVertex outVtx = tEd.outVertex(); + Iterator<VertexProperty<Object>> pI = outVtx.properties(); + String infStr = ">>> Found Vertex with VertexId = " + outVtx.id() + + ", properties: "; + System.out.println( infStr ); + logger.info(infStr); + while( pI.hasNext() ){ + VertexProperty<Object> tp = pI.next(); + infStr = " [" + tp.key() + "|" + tp.value() + "] "; + System.out.println( infStr ); + logger.info(infStr); + } + } + catch( Exception ex ){ + infMsg = " Could not retrieve vertex data for the OUT side of " + + "the edge. exMsg = [" + ex.getMessage() + "] "; + System.out.println( infMsg ); + logger.info(infMsg); + } + + }// end showPropertiesForEdge() + + + + public static ArrayList <String> collectEdgeInfoForNode( EELFLogger logger, Vertex tVert, boolean displayAllVidsFlag ){ + ArrayList <String> retArr = new ArrayList <String> (); + Direction dir = Direction.OUT; + for ( int i = 0; i <= 1; i++ ){ + if( i == 1 ){ + // Second time through we'll look at the IN edges. + dir = Direction.IN; + } + Iterator <Edge> eI = tVert.edges(dir); + if( ! eI.hasNext() ){ + retArr.add("No " + dir + " edges were found for this vertex. "); + } + while( eI.hasNext() ){ + Edge ed = eI.next(); + String lab = ed.label(); + Vertex vtx = null; + if( dir == Direction.OUT ){ + // get the vtx on the "other" side + vtx = ed.inVertex(); + } + else { + // get the vtx on the "other" side + vtx = ed.outVertex(); + } + if( vtx == null ){ + retArr.add(" >>> COULD NOT FIND VERTEX on the other side of this edge edgeId = " + ed.id() + " <<< "); + } + else { + String nType = vtx.<String>property("aai-node-type").orElse(null); + if( displayAllVidsFlag ){ + // This should rarely be needed + String vid = vtx.id().toString(); + retArr.add("Found an " + dir + " edge (" + lab + ") between this vertex and a [" + nType + "] node with VtxId = " + vid ); + } + else { + // This is the normal case + retArr.add("Found an " + dir + " edge (" + lab + ") between this vertex and a [" + nType + "] node. "); + } + } + } + } + return retArr; + + }// end of collectEdgeInfoForNode() + + + public static int countEdges( EELFLogger logger, Vertex vtx ){ + int edgeCount = 0; + try { + Iterator<Edge> edgesItr = vtx.edges(Direction.BOTH); + while( edgesItr.hasNext() ){ + edgesItr.next(); + edgeCount++; + } + } + catch (Exception e) { + String wMsg = "-- ERROR -- Stopping the counting of edges because of Exception [" + e.getMessage() + "]"; + System.out.println( wMsg ); + logger.warn( wMsg ); + } + return edgeCount; + + }// end of countEdges() + + + public static int countDescendants(EELFLogger logger, TitanVertex vtx, int levelVal ){ + int totalCount = 0; + int thisLevel = levelVal + 1; + + if( thisLevel > MAXDESCENDENTDEPTH ){ + String wMsg = "Warning -- Stopping the counting of descendents because we reached the max depth of " + MAXDESCENDENTDEPTH; + System.out.println( wMsg ); + logger.warn( wMsg ); + return totalCount; + } + + try { + Iterable <?> verts = vtx.query().direction(Direction.OUT).has("isParent",true).vertices(); + Iterator <?> vertI = verts.iterator(); + while( vertI != null && vertI.hasNext() ){ + totalCount++; + TitanVertex childVtx = (TitanVertex) vertI.next(); + totalCount = totalCount + countDescendants( logger, childVtx, thisLevel ); + } + } + catch (Exception e) { + String wMsg = "Error -- Stopping the counting of descendents because of Exception [" + e.getMessage() + "]"; + System.out.println( wMsg ); + logger.warn( wMsg ); + } + + return totalCount; + }// end of countDescendants() + + + public static boolean getEdgeDelConfirmation( EELFLogger logger, String uid, TitanEdge ed, + Boolean overRideProtection ) { + + showPropertiesForEdge( logger, ed ); + System.out.print("\n Are you sure you want to delete this EDGE? (y/n): "); + Scanner s = new Scanner(System.in); + s.useDelimiter(""); + String confirm = s.next(); + s.close(); + + if (!confirm.equalsIgnoreCase("y")) { + String infMsg = " User [" + uid + "] has chosen to abandon this delete request. "; + System.out.println("\n" + infMsg); + logger.info(infMsg); + return false; + } + else { + String infMsg = " User [" + uid + "] has confirmed this delete request. "; + System.out.println("\n" + infMsg); + logger.info(infMsg); + return true; + } + + } // End of getEdgeDelConfirmation() + + + public static boolean getNodeDelConfirmation( EELFLogger logger, String uid, Vertex vtx, int edgeCount, + int descendantCount, Boolean overRideProtection ) { + String thisNodeType = ""; + try { + thisNodeType = vtx.<String>property("aai-node-type").orElse(null); + } + catch ( Exception nfe ){ + // Let the user know something is going on - but they can confirm the delete if they want to. + String infMsg = " -- WARNING -- could not get an aai-node-type for this vertex. -- WARNING -- "; + System.out.println( infMsg ); + logger.warn( infMsg ); + } + + String ntListString = ""; + String maxDescString = ""; + String maxEdgeString = ""; + + int maxDescCount = 10; // default value + int maxEdgeCount = 10; // default value + ArrayList <String> protectedNTypes = new ArrayList <String> (); + protectedNTypes.add("cloud-region"); // default value + + try { + ntListString = AAIConfig.get("aai.forceDel.protected.nt.list"); + maxDescString = AAIConfig.get("aai.forceDel.protected.descendant.count"); + maxEdgeString = AAIConfig.get("aai.forceDel.protected.edge.count"); + } + catch ( Exception nfe ){ + // Don't worry, we will use default values + String infMsg = "-- WARNING -- could not get aai.forceDel.protected values from aaiconfig.properties -- will use default values. "; + System.out.println( infMsg ); + logger.warn( infMsg ); + } + + if( maxDescString != null && !maxDescString.equals("") ){ + try { + maxDescCount = Integer.parseInt(maxDescString); + } + catch ( Exception nfe ){ + // Don't worry, we will leave "maxDescCount" set to the default value + } + } + + if( maxEdgeString != null && !maxEdgeString.equals("") ){ + try { + maxEdgeCount = Integer.parseInt(maxEdgeString); + } + catch ( Exception nfe ){ + // Don't worry, we will leave "maxEdgeCount" set to the default value + } + } + + if( ntListString != null && !ntListString.trim().equals("") ){ + String [] nodeTypes = ntListString.split("\\|"); + for( int i = 0; i < nodeTypes.length; i++ ){ + protectedNTypes.add(nodeTypes[i]); + } + } + + boolean giveProtOverRideMsg = false; + boolean giveProtErrorMsg = false; + if( descendantCount > maxDescCount ){ + // They are trying to delete a node with a lots of descendants + String infMsg = " >> WARNING >> This node has more descendant edges than the max ProtectedDescendantCount: " + edgeCount + ". Max = " + + maxEdgeCount + ". It can be DANGEROUS to delete one of these. << WARNING << "; + System.out.println(infMsg); + logger.info(infMsg); + if( ! overRideProtection ){ + // They cannot delete this kind of node without using the override option + giveProtErrorMsg = true; + } + else { + giveProtOverRideMsg = true; + } + } + + if( edgeCount > maxEdgeCount ){ + // They are trying to delete a node with a lot of edges + String infMsg = " >> WARNING >> This node has more edges than the max ProtectedEdgeCount: " + edgeCount + ". Max = " + + maxEdgeCount + ". It can be DANGEROUS to delete one of these. << WARNING << "; + System.out.println(infMsg); + logger.info(infMsg); + if( ! overRideProtection ){ + // They cannot delete this kind of node without using the override option + giveProtErrorMsg = true; + } + else { + giveProtOverRideMsg = true; + } + } + + if( thisNodeType != null && !thisNodeType.equals("") && protectedNTypes.contains(thisNodeType) ){ + // They are trying to delete a protected Node Type + String infMsg = " >> WARNING >> This node is a PROTECTED NODE-TYPE (" + thisNodeType + "). " + + " It can be DANGEROUS to delete one of these. << WARNING << "; + System.out.println(infMsg); + logger.info(infMsg); + if( ! overRideProtection ){ + // They cannot delete this kind of node without using the override option + giveProtErrorMsg = true; + } + else { + giveProtOverRideMsg = true; + } + } + + if( giveProtOverRideMsg ){ + String infMsg = " !!>> WARNING >>!! you are using the overRideProtection parameter which will let you do this potentially dangerous delete."; + System.out.println("\n" + infMsg); + logger.info(infMsg); + } + else if( giveProtErrorMsg ) { + String errMsg = " ERROR >> this kind of node can only be deleted if you pass the overRideProtection parameter."; + System.out.println("\n" + errMsg); + logger.error(errMsg); + return false; + } + + System.out.print("\n Are you sure you want to do this delete? (y/n): "); + Scanner s = new Scanner(System.in); + s.useDelimiter(""); + String confirm = s.next(); + s.close(); + + if (!confirm.equalsIgnoreCase("y")) { + String infMsg = " User [" + uid + "] has chosen to abandon this delete request. "; + System.out.println("\n" + infMsg); + logger.info(infMsg); + return false; + } + else { + String infMsg = " User [" + uid + "] has confirmed this delete request. "; + System.out.println("\n" + infMsg); + logger.info(infMsg); + return true; + } + + } // End of getNodeDelConfirmation() + +} + + diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLReaderNew.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLReaderNew.java new file mode 100644 index 0000000..4f3fee0 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLReaderNew.java @@ -0,0 +1,353 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.lang.reflect.Array; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; + +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.XMLEvent; + +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Vertex; + +//import com.infrasight.model.UnicodeUtil; +import com.thinkaurelius.titan.core.TitanGraph; + +/** + * GraphMLReader writes the data from a GraphML stream to a graph. + */ +public class GraphMLReaderNew { + public static final Charset charset = Charset.forName("UTF8"); + + /** + * Input the GraphML stream data into the graph. + * In practice, usually the provided graph is empty. + * + * @param graph the graph to populate with the GraphML data + * @param titanGraph the titan graph + * @param graphMLInputStream an InputStream of GraphML data + * @return the map + * @throws XMLStreamException thrown when the GraphML data is not correctly formatted + */ + public static Map<String, Object> inputGraph(final Graph graph, final TitanGraph titanGraph, final InputStream graphMLInputStream) throws XMLStreamException { + return inputGraph(graph, titanGraph, new InputStreamReader(graphMLInputStream, charset), 1000); + } + +/* public static void inputGraphFiltered(final Graph graph, final InputStream graphMLInputStream) throws XMLStreamException { + inputGraph(graph, UnicodeUtil.createFilteredReader(new InputStreamReader(graphMLInputStream, charset)), 1000); + }*/ + + private static class KeySpec { + String attrName; + String attrType; + + /** + * Instantiates a new key spec. + * + * @param name the name + * @param type the type + */ + public KeySpec(String name, String type) { + this.attrName = name; + this.attrType = type; + } + } + + /** + * Input the GraphML stream data into the graph. + * More control over how data is streamed is provided by this method. + * + * @param graph the graph to populate with the GraphML data + * @param titanGraph the titan graph + * @param inputReader an Reader of GraphML character data + * @param bufferSize the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs) + * @return the map + * @throws XMLStreamException thrown when the GraphML data is not correctly formatted + */ + public static Map<String, Object> inputGraph(final Graph graph, final TitanGraph titanGraph, final Reader inputReader, int bufferSize) throws XMLStreamException { + + XMLInputFactory inputFactory = XMLInputFactory.newInstance(); + inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); + inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); + XMLStreamReader reader = inputFactory.createXMLStreamReader(inputReader); + + //final BatchGraph<?> graph = BatchGraph.wrap(inputGraph, bufferSize); + + Map<String, KeySpec> keyMap = new HashMap<String, KeySpec>(); + + // Buffered Vertex Data + String vertexId = null; + Map<String, Object> vertexProps = null; + boolean inVertex = false; + + // Buffered Edge Data + String edgeId = null; + String edgeLabel = null; + Vertex edgeInVertex = null; + Vertex edgeOutVertex = null; + Map<String, Object> edgeProps = null; + boolean inEdge = false; + Map<String, Object> vertexIdSetMap = new HashMap<String, Object>(); + + while (reader.hasNext()) { + + Integer eventType = reader.next(); + if (eventType.equals(XMLEvent.START_ELEMENT)) { + String elementName = reader.getName().getLocalPart(); + + if (elementName.equals(GraphMLTokens.KEY)) { + String id = reader.getAttributeValue(null, GraphMLTokens.ID); + String attributeName = reader.getAttributeValue(null, GraphMLTokens.ATTR_NAME); + String attributeType = reader.getAttributeValue(null, GraphMLTokens.ATTR_TYPE); + keyMap.put(id, new KeySpec(attributeName, attributeType)); + + } else if (elementName.equals(GraphMLTokens.NODE)) { + vertexId = reader.getAttributeValue(null, GraphMLTokens.ID); + inVertex = true; + vertexProps = new HashMap<String, Object>(); + + } else if (elementName.equals(GraphMLTokens.EDGE)) { + + + edgeId = reader.getAttributeValue(null, GraphMLTokens.ID); + edgeLabel = reader.getAttributeValue(null, GraphMLTokens.LABEL); + edgeLabel = edgeLabel == null ? GraphMLTokens._DEFAULT : edgeLabel; + + String outVertexId = reader.getAttributeValue(null, GraphMLTokens.SOURCE); + String inVertexId = reader.getAttributeValue(null, GraphMLTokens.TARGET); + + edgeOutVertex = graph.vertices(outVertexId).next(); + edgeInVertex = graph.vertices(inVertexId).next(); + + if (null == edgeOutVertex) { + edgeOutVertex = graph.addVertex(outVertexId); + } + if (null == edgeInVertex) { + edgeInVertex = graph.addVertex(inVertexId); + } + + inEdge = true; + edgeProps = new HashMap<String, Object>(); + + } else if (elementName.equals(GraphMLTokens.DATA)) { + String key = reader.getAttributeValue(null, GraphMLTokens.KEY); + KeySpec keySpec = keyMap.get(key); + + if (keySpec != null) { + Object value = readData(reader, keySpec.attrType); + if(value == null) + throw new RuntimeException("Empty data"); + if (inVertex == true) { + vertexProps.put(keySpec.attrName, value); + } else if (inEdge == true) { + edgeProps.put(keySpec.attrName, value); + } + } + + } + } else if (eventType.equals(XMLEvent.END_ELEMENT)) { + String elementName = reader.getName().getLocalPart(); + + if (elementName.equals(GraphMLTokens.NODE)) { + + Vertex currentVertex = graph.vertices(vertexId).next(); + if (currentVertex != null) + throw new RuntimeException("Duplicate vertex ID: "+vertexId); + currentVertex = graph.addVertex(vertexId); + Boolean hasCollection = false; + for (Entry<String, Object> prop : vertexProps.entrySet()) { + // multi-properties need a addProperty and need to use a TitanVertex - BluePrint + // Vertex does not support this + Object value = prop.getValue(); + if (value instanceof Collection) { + hasCollection = true; + vertexIdSetMap.put(currentVertex.id().toString() + "." + prop.getKey(), vertexProps); + currentVertex.property("has-collection", "true"); + } else { + currentVertex.property(prop.getKey(), value); + } + } + if (hasCollection) + System.out.println("---Found node with SET property vertex id:" + vertexId + " properties:" + vertexProps.toString()); + vertexId = null; + vertexProps = null; + inVertex = false; + } else if (elementName.equals(GraphMLTokens.EDGE)) { + Edge currentEdge = edgeOutVertex.addEdge(edgeLabel, edgeInVertex); + //addEdge(edgeId, edgeOutVertex, edgeInVertex, edgeLabel); + + for (Entry<String, Object> prop : edgeProps.entrySet()) { + currentEdge.property(prop.getKey(), prop.getValue()); + } + + edgeId = null; + edgeLabel = null; + edgeInVertex = null; + edgeOutVertex = null; + edgeProps = null; + inEdge = false; + } + + } + + } + + reader.close(); + graph.tx().close(); + + return vertexIdSetMap; + + } + + /** + * Read data. + * + * @param reader the reader + * @param type the type + * @return the object + * @throws XMLStreamException the XML stream exception + */ + private static Object readData(XMLStreamReader reader, String type) throws XMLStreamException { + Collection<Object> col = new ArrayList<Object>(); + + int pos = type.indexOf('-'); + if(pos < 0) + return typeCastValue(reader.getElementText(), type); + String arrayType = type.substring(0, pos); + type = type.substring(pos+1); + + boolean done = false; + while(!done) { + Integer eventType = reader.next(); + if(eventType.equals(XMLEvent.START_ELEMENT)) { + String text = reader.getElementText(); + Object value = typeCastValue(text, type); + col.add(value); + } + if(eventType.equals(XMLEvent.END_ELEMENT)) { + String elementName = reader.getName().getLocalPart(); + if(elementName.equals(GraphMLTokens.DATA)) { + done = true; + continue; + } + } + } + + if(arrayType.equals(GraphMLTokens.ARRAY)) { + Object arr = Array.newInstance(typeToClass(type), col.size()); + int i = 0; + for(Object obj : col) { + Array.set(arr, i, obj); + i++; + } + return arr; + } + else if(arrayType.equals(GraphMLTokens.SET)) + return new HashSet<Object>(col); + else if(type.startsWith(GraphMLTokens.LIST)) + return new HashSet<Object>(col); + + return col; + } + + /** + * Type to class. + * + * @param type the type + * @return the class + */ + private static Class<?> typeToClass(String type) { + if (type.equals(GraphMLTokens.STRING)) + return String.class; + else if (type.equals(GraphMLTokens.FLOAT)) + return Float.TYPE; + else if (type.equals(GraphMLTokens.INT)) + return Integer.TYPE; + else if (type.equals(GraphMLTokens.DOUBLE)) + return Double.TYPE; + else if (type.equals(GraphMLTokens.BOOLEAN)) + return Boolean.TYPE; + else if (type.equals(GraphMLTokens.LONG)) + return Long.TYPE; + else + throw new RuntimeException("Unsupported type: "+type); + } + + /** + * Type cast value. + * + * @param value the value + * @param type the type + * @return the object + */ + private static Object typeCastValue(String value, String type) { + if (type.equals(GraphMLTokens.STRING)) + return value; + else if (type.equals(GraphMLTokens.FLOAT)) + return Float.valueOf(value); + else if (type.equals(GraphMLTokens.INT)) + return Integer.valueOf(value); + else if (type.equals(GraphMLTokens.DOUBLE)) + return Double.valueOf(value); + else if (type.equals(GraphMLTokens.BOOLEAN)) + return Boolean.valueOf(value); + else if (type.equals(GraphMLTokens.LONG)) + return Long.valueOf(value); + else + throw new RuntimeException("Unsupported type: "+type); + } + +/* TitanVertex titanVertex = (TitanVertex) titanGraph.getVertex(vertexId); + if (titanVertex != null) + throw new RuntimeException("Duplicate vertex ID: "+vertexId); + titanVertex = (TitanVertex) titanGraph.addVertex(vertexId); + for (Entry<String, Object> prop : vertexProps.entrySet()) { + // multi-properties need a addProperty and need to use a TitanVertex - BluePrint + // Vertex does not support this + Object value = prop.getValue(); + if (value instanceof Collection) { + try { + for(Object obj : ((Collection<?>)value)) { + System.out.println("vertex id:property name:property value="+ vertexId + ":" + prop.getKey() + ":" + obj.toString()); + titanVertex.addProperty(prop.getKey(), obj.toString()); + } + } + catch (Exception e) { + System.out.println("Can't set SET/LIST properties - skipping"); + } + + } else + titanVertex.setProperty(prop.getKey(), prop.getValue()); + }*/ +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLTokens.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLTokens.java new file mode 100644 index 0000000..f863a52 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLTokens.java @@ -0,0 +1,57 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + +/** + * A collection of tokens used for GraphML related data. + */ +public class GraphMLTokens { + public static final String GRAPHML = "graphml"; + public static final String XMLNS = "xmlns"; + public static final String GRAPHML_XMLNS = "http://graphml.graphdrawing.org/xmlns"; + public static final String G = "G"; + public static final String EDGEDEFAULT = "edgedefault"; + public static final String DIRECTED = "directed"; + public static final String KEY = "key"; + public static final String FOR = "for"; + public static final String ID = "id"; + public static final String ATTR_NAME = "attr.name"; + public static final String ATTR_TYPE = "attr.type"; + public static final String GRAPH = "graph"; + public static final String NODE = "node"; + public static final String EDGE = "edge"; + public static final String SOURCE = "source"; + public static final String TARGET = "target"; + public static final String DATA = "data"; + public static final String LABEL = "label"; + public static final String STRING = "string"; + public static final String FLOAT = "float"; + public static final String DOUBLE = "double"; + public static final String LONG = "long"; + public static final String BOOLEAN = "boolean"; + public static final String INT = "int"; + public static final String ARRAY = "array"; + public static final String SET = "set"; + public static final String LIST = "list"; + public static final String ITEM = "item"; + public static final String _DEFAULT = "_default"; + +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLWriterNew.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLWriterNew.java new file mode 100644 index 0000000..1704428 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/GraphMLWriterNew.java @@ -0,0 +1,358 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + + +import java.io.OutputStream; +import java.lang.reflect.Array; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; + +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.Property; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; + +/** + * GraphMLWriter writes a Graph to a GraphML OutputStream. + */ +public class GraphMLWriterNew { + + private static class KeySpec { + String attrName; + String attrType; + + /** + * Instantiates a new key spec. + * + * @param name the name + * @param type the type + */ + public KeySpec(String name, String type) { + this.attrName = name; + this.attrType = type; + } + } + + /** + * Write the data in a Graph to a GraphML OutputStream. + * + * @param graph the Graph to pull the data from + * @param graphMLOutputStream the GraphML OutputStream to write the Graph data to + * @throws XMLStreamException thrown if there is an error generating the GraphML data + */ + public static void outputGraph(final Graph graph, final OutputStream graphMLOutputStream) throws XMLStreamException { + Map<String, KeySpec> vertexKeyTypes = new HashMap<String, KeySpec>(); + Map<String, KeySpec> edgeKeyTypes = new HashMap<String, KeySpec>(); + + + Iterator<Vertex> vertices = graph.vertices(); + Vertex vertex = null; + Iterator<VertexProperty<Object>> propertyIterator = null; + VertexProperty<Object> property = null; + while (vertices.hasNext()) { + vertex = vertices.next(); + propertyIterator = vertex.properties(); + while (propertyIterator.hasNext()) { + property = propertyIterator.next(); + Object value = property.value(); + String key = property.key(); + if(value == null) + continue; + String type = getStringType(value); + if(type == null) + continue; + String id = key+"-"+type; + if (!vertexKeyTypes.containsKey(id)) { + vertexKeyTypes.put(id, new KeySpec(key, type)); + } + } + } + Iterator<Edge> edges = graph.edges(); + Edge edge = null; + Iterator<Property<Object>> edgePropertyIterator = null; + Property<Object> edgeProperty = null; + + while (edges.hasNext()) { + edge = edges.next(); + edgePropertyIterator = edge.properties(); + while (edgePropertyIterator.hasNext()) { + edgeProperty = edgePropertyIterator.next(); + Object value = edgeProperty.value(); + String key = edgeProperty.key(); + if(value == null) + continue; + String type = getStringType(value); + if(type == null) + continue; + String id = key+"-"+type; + if (!edgeKeyTypes.containsKey(id)) { + edgeKeyTypes.put(id, new KeySpec(key, type)); + } + } + } + outputGraph(graph, graphMLOutputStream, vertexKeyTypes, edgeKeyTypes); + } + + /** + * Write the data in a Graph to a GraphML OutputStream. + * + * @param graph the Graph to pull the data from + * @param graphMLOutputStream the GraphML OutputStream to write the Graph data to + * @param vertexKeyTypes a Map of the data types of the vertex keys + * @param edgeKeyTypes a Map of the data types of the edge keys + * @throws XMLStreamException thrown if there is an error generating the GraphML data + */ + public static void outputGraph(final Graph graph, final OutputStream graphMLOutputStream, final Map<String, KeySpec> vertexKeyTypes, final Map<String, KeySpec> edgeKeyTypes) throws XMLStreamException { + XMLOutputFactory inputFactory = XMLOutputFactory.newInstance(); + XMLStreamWriter writer = inputFactory.createXMLStreamWriter(graphMLOutputStream, "UTF8"); + + writer.writeStartDocument("UTF-8", "1.0"); + writer.writeStartElement(GraphMLTokens.GRAPHML); + writer.writeAttribute(GraphMLTokens.XMLNS, GraphMLTokens.GRAPHML_XMLNS); + //<key id="weight" for="edge" attr.name="weight" attr.type="float"/> + for (Map.Entry<String, KeySpec> entry : vertexKeyTypes.entrySet()) { + writer.writeStartElement(GraphMLTokens.KEY); + writer.writeAttribute(GraphMLTokens.ID, entry.getKey()); + writer.writeAttribute(GraphMLTokens.FOR, GraphMLTokens.NODE); + writer.writeAttribute(GraphMLTokens.ATTR_NAME, entry.getValue().attrName); + writer.writeAttribute(GraphMLTokens.ATTR_TYPE, entry.getValue().attrType); + writer.writeEndElement(); + } + for (Map.Entry<String, KeySpec> entry : edgeKeyTypes.entrySet()) { + writer.writeStartElement(GraphMLTokens.KEY); + writer.writeAttribute(GraphMLTokens.ID, entry.getKey()); + writer.writeAttribute(GraphMLTokens.FOR, GraphMLTokens.EDGE); + writer.writeAttribute(GraphMLTokens.ATTR_NAME, entry.getValue().attrName); + writer.writeAttribute(GraphMLTokens.ATTR_TYPE, entry.getValue().attrType); + writer.writeEndElement(); + } + + writer.writeStartElement(GraphMLTokens.GRAPH); + writer.writeAttribute(GraphMLTokens.ID, GraphMLTokens.G); + writer.writeAttribute(GraphMLTokens.EDGEDEFAULT, GraphMLTokens.DIRECTED); + Iterator<Vertex> vertices = graph.vertices(); + Vertex vertex = null; + Iterator<VertexProperty<Object>> propertyIterator = null; + VertexProperty<Object> property = null; + while (vertices.hasNext()) { + vertex = vertices.next(); + writer.writeStartElement(GraphMLTokens.NODE); + writer.writeAttribute(GraphMLTokens.ID, vertex.id().toString()); + propertyIterator = vertex.properties(); + while (propertyIterator.hasNext()) { + property = propertyIterator.next(); + String key = property.key(); + writeData(writer, key, property.value()); + } + writer.writeEndElement(); + } + + Iterator<Edge> edges = graph.edges(); + Edge edge = null; + Iterator<Property<Object>> edgePropertyIterator = null; + Property<Object> edgeProperty = null; + + while (edges.hasNext()) { + edge = edges.next(); + edgePropertyIterator = edge.properties(); + writer.writeStartElement(GraphMLTokens.EDGE); + writer.writeAttribute(GraphMLTokens.ID, edge.id().toString()); + writer.writeAttribute(GraphMLTokens.SOURCE, edge.outVertex().id().toString()); + writer.writeAttribute(GraphMLTokens.TARGET, edge.inVertex().id().toString()); + writer.writeAttribute(GraphMLTokens.LABEL, edge.label()); + + while (edgePropertyIterator.hasNext()) { + edgeProperty = edgePropertyIterator.next(); + String key = edgeProperty.key(); + writeData(writer, key, edgeProperty.value()); + } + writer.writeEndElement(); + } + + writer.writeEndElement(); // graph + writer.writeEndElement(); // graphml + writer.writeEndDocument(); + + writer.flush(); + writer.close(); + + } + + /** + * Write data. + * + * @param writer the writer + * @param key the key + * @param value the value + * @throws XMLStreamException the XML stream exception + */ + private static void writeData(XMLStreamWriter writer, String key, Object value) throws XMLStreamException { + if(value == null) + return; + String type = getStringType(value); + if(type == null) + return; + String id = key+"-"+type; + + writer.writeStartElement(GraphMLTokens.DATA); + writer.writeAttribute(GraphMLTokens.KEY, id); + if(type.startsWith(GraphMLTokens.ARRAY) || + type.startsWith(GraphMLTokens.LIST) || + type.startsWith(GraphMLTokens.SET)) + writeDataArray(writer, value); + else + writer.writeCharacters(propertyValueToString(value)); + writer.writeEndElement(); + } + + /** + * Write data array. + * + * @param writer the writer + * @param value the value + * @throws XMLStreamException the XML stream exception + */ + private static void writeDataArray(XMLStreamWriter writer, Object value) throws XMLStreamException { + if(value.getClass().isArray()) { + for(int i = 0; i < Array.getLength(value); i++) { + writer.writeStartElement(GraphMLTokens.ITEM); + writer.writeCharacters(Array.get(value, i).toString()); + writer.writeEndElement(); + } + } + else if(value instanceof Collection) { + for(Object obj : ((Collection<?>)value)) { + writer.writeStartElement(GraphMLTokens.ITEM); + writer.writeCharacters(obj.toString()); + writer.writeEndElement(); + } + } + } + + /** + * Gets the string type. + * + * @param object the object + * @return the string type + */ + private static String getStringType(final Object object) { + if(object.getClass().isArray()) + return GraphMLTokens.ARRAY+"-"+getStringType(object.getClass().getComponentType()); + if(object instanceof Collection) { + String colType; + if(object instanceof Set) + colType = GraphMLTokens.SET; + else if(object instanceof List) + colType = GraphMLTokens.LIST; + else + throw new RuntimeException("Unhandled Collection type: "+object.getClass()); + + Collection<?> col = (Collection<?>)object; + if(col.size() == 0) + return null; + return colType+"-"+getStringType(col.iterator().next()); + } + if (object instanceof String) + return GraphMLTokens.STRING; + else if (object instanceof Integer) + return GraphMLTokens.INT; + else if (object instanceof Long) + return GraphMLTokens.LONG; + else if (object instanceof Float) + return GraphMLTokens.FLOAT; + else if (object instanceof Double) + return GraphMLTokens.DOUBLE; + else if (object instanceof Boolean) + return GraphMLTokens.BOOLEAN; + else + throw new RuntimeException("Unsupported type: "+object.getClass()); + } + + /** + * Gets the string type. + * + * @param clazz the clazz + * @return the string type + */ + private static String getStringType(final Class<?> clazz) { + if(clazz.equals(String.class)) + return GraphMLTokens.STRING; + else if(clazz.equals(Integer.TYPE) || clazz.equals(Integer.class)) + return GraphMLTokens.INT; + else if(clazz.equals(Long.TYPE) || clazz.equals(Long.class)) + return GraphMLTokens.LONG; + else if(clazz.equals(Float.TYPE) || clazz.equals(Float.class)) + return GraphMLTokens.FLOAT; + else if(clazz.equals(Double.TYPE) || clazz.equals(Double.class)) + return GraphMLTokens.DOUBLE; + else if(clazz.equals(Boolean.TYPE) || clazz.equals(Boolean.class)) + return GraphMLTokens.BOOLEAN; + else + throw new RuntimeException("Unsupported array item type: "+clazz); + } + + /** + * Property value to string. + * + * @param value the value + * @return the string + */ + private static String propertyValueToString(Object value) { + if(value == null) + return null; + + if(value.getClass().isArray()) { + String str = "["; + for(int i = 0; i < Array.getLength(value); i++) { + if(i > 0) + str += ", "; + str += Array.get(value, i); + } + str += "]"; + return str; + } + else if(value instanceof Collection) { + String str = "["; + int i = 0; + for(Object obj : ((Collection<?>)value)) { + if(i > 0) + str += ", "; + str += obj.toString(); + i++; + } + str += "]"; + return str; + } + return value.toString(); + } + +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/PropertyNameChange.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/PropertyNameChange.java new file mode 100644 index 0000000..3f7f351 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/PropertyNameChange.java @@ -0,0 +1,317 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + +import java.util.Iterator; +import java.util.Properties; + +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; + +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.logging.ErrorLogHelper; +import org.openecomp.aai.util.AAIConfig; +import org.openecomp.aai.util.AAIConstants; +import com.att.eelf.configuration.Configuration; +import com.thinkaurelius.titan.core.PropertyKey; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanProperty; +import com.thinkaurelius.titan.core.TitanVertex; +import com.thinkaurelius.titan.core.schema.TitanManagement; + + +public class PropertyNameChange { + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + + // Set the logging file properties to be used by EELFManager + Properties props = System.getProperties(); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); + + // NOTE -- We're just working with properties that are used for NODES for now. + + TitanGraph graph = null; + TitanManagement graphMgt = null;; + Boolean preserveData = true; + String propName = ""; + String targetPropName = ""; + String targetNodeType = ""; + String skipCommit = ""; + boolean noCommit = false; + + + String usageString = "Usage: PropertyNameChange propertyName targetPropertyName nodeType(or NA) skipCommit(true|false) \n"; + if( args.length != 4 ){ + String emsg = "Four Parameters are required. \n" + usageString; + System.out.println( emsg ); + System.exit(1); + } + else { + propName = args[0]; + targetPropName = args[1]; + targetNodeType = args[2]; + skipCommit = args[3]; + if ( skipCommit.toLowerCase().equals("true")) + noCommit = true; + } + + if( propName.equals("") ){ + String emsg = "Bad parameter - propertyName cannot be empty. \n" + usageString; + System.out.println( emsg ); + System.exit(1); + } + + + + try { + AAIConfig.init(); + ErrorLogHelper.loadProperties(); + } + catch( Exception ae ){ + String emsg = "Problem with either AAIConfig.init() or ErrorLogHelper.LoadProperties(). "; + System.out.println( emsg + "[" + ae.getMessage() + "]"); + System.exit(1); + } + + + System.out.println(">>> Processing will begin in 5 seconds (unless interrupted). <<<"); + try { + // Give them a chance to back out of this + Thread.sleep(5000); + } catch ( java.lang.InterruptedException ie) { + System.out.println( " DB Schema Update has been aborted. "); + System.exit(1); + } + + try { + System.out.println(" ---- NOTE --- about to open graph (takes a little while)\n"); + + graph = AAIGraph.getInstance().getGraph(); + if( graph == null ){ + String emsg = "Not able to get a graph object in SchemaMod.java\n"; + System.out.println( emsg ); + System.exit(1); + } + + // Make sure this property is in the DB. + graphMgt = graph.openManagement(); + if( graphMgt == null ){ + String emsg = "Not able to get a graph Management object in SchemaMod.java\n"; + System.out.println( emsg ); + System.exit(1); + } + PropertyKey origPropKey = graphMgt.getPropertyKey(propName); + if( origPropKey == null ){ + String emsg = "The propName = [" + propName + "] is not defined in our graph. "; + System.out.println( emsg ); + System.exit(1); + } + origPropKey = graphMgt.getPropertyKey(targetPropName); + if( origPropKey == null ){ + String emsg = "The targetPropName = [" + targetPropName + "] is not defined in our graph. "; + System.out.println( emsg ); + System.exit(1); + } + + if ( !targetNodeType.equals("NA")) { + if ( graphMgt.getVertexLabel(targetNodeType) == null ) { + String emsg = "The targetNodeType = [" + targetNodeType + "] is not defined in our graph. "; + System.out.println( emsg ); + System.exit(1); + } + } + + // For each node that has this property, update the new from the old and then remove the + // old property from that node + Iterable<TitanVertex> verts = null; + int vtxCount = 0; + String label; + long longId; + + int propertyCount; + + Iterator<VertexProperty<Object>> titanProperties = null; + + VertexProperty<Object> tmpProperty = null; + Object origVal; + Object targetVal; + + if ( targetNodeType.equals("NA")) { + verts= graph.query().has(propName).vertices(); + Iterator<TitanVertex> it = verts.iterator(); + + while( it.hasNext() ){ + + TitanVertex tmpVtx = (TitanVertex)it.next(); + String tmpVid = tmpVtx.id().toString(); + + origVal = tmpVtx.<Object>property(propName).orElse(null); + targetVal = tmpVtx.<Object>property(targetPropName).orElse(null); + + label = tmpVtx.label(); + longId = tmpVtx.longId(); + + if ( targetVal != null ) { + System.out.println( "vertex [" + label + "] id " + tmpVid + " has " + targetPropName + + " with value " + targetVal + ", skip adding with value " + origVal); + continue; + } + vtxCount++; + titanProperties = tmpVtx.properties(); // current properties + + propertyCount = 0; + + while( titanProperties.hasNext() ){ + + tmpProperty = titanProperties.next(); + + if ( propertyCount == 0 ) + System.out.print( "adding to [" + label + "] vertex id " + tmpVid + " with existing properties " + + tmpProperty.toString() ); + else + System.out.print(", " + tmpProperty.toString()); + ++propertyCount; + } + + if ( propertyCount > 0 ) { + System.out.println(""); + + tmpVtx.property(targetPropName,origVal); + System.out.println("INFO -- just did the add using " + longId + + " with label " + label + "] and updated it with the orig value (" + + origVal.toString() + ")"); + titanProperties = tmpVtx.properties(); // current properties + propertyCount = 0; + + + while( titanProperties.hasNext() ){ + tmpProperty = titanProperties.next(); + if ( propertyCount == 0 ) + System.out.print( "new property list for [" + label + "] vertex id " + tmpVid + " with existing properties " + + tmpProperty.toString() ); + else + System.out.print(", " + tmpProperty.toString()); + ++propertyCount; + } + + if ( propertyCount > 0 ) + System.out.println(""); + } + } + } else { + // targetNodeType is NA + + verts= graph.query().has("aai-node-type", targetNodeType).vertices(); + if( verts != null ){ + // We did find some matching vertices + Iterator <?> it = verts.iterator(); + Object propVal; + while( it.hasNext() ){ + TitanVertex v = (TitanVertex)it.next(); + label = v.label(); + longId = v.longId(); + targetVal = v.<Object>property(targetPropName).orElse(null); + origVal = v.<Object>property(propName).orElse(null); + + if ( origVal == null) + continue; + + if ( targetVal != null ) { + System.out.println( "vertex [" + label + "] id " + longId + " has " + targetPropName + + " with value " + targetVal + ", skip adding with value " + origVal); + continue; + } + titanProperties = v.properties(); // current properties + propertyCount = 0; + if ( v.<Object>property(propName).orElse(null) != null ) { + propVal = v.<Object>property(propName).orElse(null); + v.property(targetPropName, propVal); + ++vtxCount; + while( titanProperties.hasNext() ){ + + tmpProperty = titanProperties.next(); + if ( propertyCount == 0 ) + System.out.print( "adding to vertex id " + longId + " with existing properties " + + tmpProperty.toString() ); + else + System.out.print(", " + tmpProperty.toString()); + ++propertyCount; + } + + if ( propertyCount > 0 ) + System.out.println(""); + System.out.println("INFO -- just did the add target [" + targetNodeType + "] using " + longId + + " with label " + label + "] and updated it with the orig value (" + + propVal.toString() + ")"); + propertyCount = 0; + while( titanProperties.hasNext() ){ + + tmpProperty = titanProperties.next(); + if ( propertyCount == 0 ) + System.out.print( "new property list for vertex [" + label + "] id " + longId + " with existing properties " + + tmpProperty.toString() ); + else + System.out.print(", " + tmpProperty.toString()); + ++propertyCount; + } + + if ( propertyCount > 0 ) + System.out.println(""); + } + } + } + + } + + System.out.println("added properties data for " + vtxCount + " vertexes. noCommit " + noCommit); + if ( !noCommit ) + graph.tx().commit(); + } + catch (Exception ex) { + System.out.print("Threw a regular Exception:\n"); + System.out.println(ex.getMessage()); + } + finally { + if( graphMgt != null && graphMgt.isOpen() ){ + // Any changes that worked correctly should have already done their commits. + graphMgt.rollback(); + } + if( graph != null ){ + // Any changes that worked correctly should have already done their commits. + graph.tx().rollback(); + graph.close(); + } + } + + System.exit(0); + + }// End of main() + + +} + + diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/SchemaMod.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/SchemaMod.java new file mode 100644 index 0000000..9cc6cf3 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/SchemaMod.java @@ -0,0 +1,441 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.Properties; +import java.util.TimeZone; +import java.util.UUID; + +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.apache.tinkerpop.gremlin.structure.VertexProperty; +import org.slf4j.MDC; + +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.ingestModel.DbMaps; +import org.openecomp.aai.ingestModel.IngestModelMoxyOxm; +import org.openecomp.aai.logging.ErrorLogHelper; +import org.openecomp.aai.util.AAIConfig; +import org.openecomp.aai.util.AAIConstants; +import org.openecomp.aai.util.UniquePropertyCheck; +import com.att.eelf.configuration.Configuration; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.thinkaurelius.titan.core.Cardinality; +import com.thinkaurelius.titan.core.PropertyKey; +import com.thinkaurelius.titan.core.TitanEdge; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanVertex; +import com.thinkaurelius.titan.core.schema.TitanManagement; + +public class SchemaMod { + + private static final String FROMAPPID = "AAI-UTILS"; + private static final String TRANSID = UUID.randomUUID().toString(); + private static final String COMPONENT = "SchemaMod"; + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + + SchemaMod.execute(args); + System.exit(0); + + }// End of main() + + /** + * Execute. + * + * @param args the args + */ + public static void execute(String[] args) { + + // Set the logging file properties to be used by EELFManager + Properties props = System.getProperties(); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_SCHEMA_MOD_LOGBACK_PROPS); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); + + EELFLogger logger = EELFManager.getInstance().getLogger(UniquePropertyCheck.class.getSimpleName()); + MDC.put("logFilenameAppender", SchemaMod.class.getSimpleName()); + + // NOTE -- We're just working with properties that are used for NODES + // for now. + + TitanGraph graph = null; + TitanManagement graphMgt = null; + + Boolean preserveData = true; + String propName = ""; + String targetDataType = ""; + String targetIndexInfo = ""; + String preserveDataFlag = ""; + + String usageString = "Usage: SchemaMod propertyName targetDataType targetIndexInfo preserveDataFlag \n"; + if (args.length != 4) { + String emsg = "Four Parameters are required. \n" + usageString; + logAndPrint(logger, emsg); + System.exit(1); + } else { + propName = args[0]; + targetDataType = args[1]; + targetIndexInfo = args[2]; + preserveDataFlag = args[3]; + } + + if (propName.equals("")) { + String emsg = "Bad parameter - propertyName cannot be empty. \n" + usageString; + logAndPrint(logger, emsg); + System.exit(1); + } else if (!targetDataType.equals("String") && !targetDataType.equals("Set<String>") + && !targetDataType.equals("Integer") && !targetDataType.equals("Long") + && !targetDataType.equals("Boolean")) { + String emsg = "Unsupported targetDataType. We only support String, Set<String>, Integer, Long or Boolean for now.\n" + + usageString; + logAndPrint(logger, emsg); + System.exit(1); + } else if (!targetIndexInfo.equals("uniqueIndex") && !targetIndexInfo.equals("index") + && !targetIndexInfo.equals("noIndex")) { + String emsg = "Unsupported IndexInfo. We only support: 'uniqueIndex', 'index' or 'noIndex'.\n" + + usageString; + logAndPrint(logger, emsg); + System.exit(1); + } else { + if (preserveDataFlag.equals("true")) { + preserveData = true; + } else if (preserveDataFlag.equals("false")) { + preserveData = false; + } else { + String emsg = "Unsupported preserveDataFlag. We only support: 'true' or 'false'.\n" + usageString; + logAndPrint(logger, emsg); + System.exit(1); + } + } + + try { + AAIConfig.init(); + ErrorLogHelper.loadProperties(); + } catch (Exception ae) { + String emsg = "Problem with either AAIConfig.init() or ErrorLogHelper.LoadProperties(). "; + logAndPrint(logger, emsg + "[" + ae.getMessage() + "]"); + System.exit(1); + } + + DbMaps dbMaps = null; + try { + ArrayList<String> apiVersions = new ArrayList<String>(); + apiVersions.add(AAIConfig.get(AAIConstants.AAI_DEFAULT_API_VERSION_PROP)); + final IngestModelMoxyOxm m = new IngestModelMoxyOxm(); + m.init(apiVersions, false); + dbMaps = m.dbMapsContainer.get(AAIConfig.get(AAIConstants.AAI_DEFAULT_API_VERSION_PROP)); + } catch (AAIException ae) { + String emsg = "Could not instantiate a copy of DbMaps. "; + logAndPrint(logger, emsg + "[" + ae.getMessage() + "]"); + System.exit(1); + } catch (Exception e) { + String emsg = "exception, Could not instantiate a copy of DbMaps. "; + logAndPrint(logger, emsg + "[" + e.getMessage() + "]"); + System.exit(1); + } + // Give a big warning if the DbMaps.PropertyDataTypeMap value does not + // agree with what we're doing + String warningMsg = ""; + /*if (!dbMaps.PropertyDataTypeMap.containsKey(propName)) { + String emsg = "Property Name = [" + propName + "] not found in PropertyDataTypeMap. "; + logAndPrint(logger, emsg); + System.exit(1); + } else { + String currentDataType = dbMaps.PropertyDataTypeMap.get(propName); + if (!currentDataType.equals(targetDataType)) { + warningMsg = "TargetDataType [" + targetDataType + "] does not match what is in DbRules.java (" + + currentDataType + ")."; + } + }*/ + + if (!warningMsg.equals("")) { + logAndPrint(logger, "\n>>> WARNING <<<< "); + logAndPrint(logger, ">>> " + warningMsg + " <<<"); + } + + logAndPrint(logger, ">>> Processing will begin in 5 seconds (unless interrupted). <<<"); + try { + // Give them a chance to back out of this + Thread.sleep(5000); + } catch (java.lang.InterruptedException ie) { + logAndPrint(logger, " DB Schema Update has been aborted. "); + System.exit(1); + } + + try { + Class dType = null; + if (targetDataType.equals("String")) { + dType = String.class; + } else if (targetDataType.equals("Set<String>")) { + dType = String.class; + } else if (targetDataType.equals("Integer")) { + dType = Integer.class; + } else if (targetDataType.equals("Boolean")) { + dType = Boolean.class; + } else if (targetDataType.equals("Character")) { + dType = Character.class; + } else if (targetDataType.equals("Long")) { + dType = Long.class; + } else if (targetDataType.equals("Float")) { + dType = Float.class; + } else if (targetDataType.equals("Double")) { + dType = Double.class; + } else { + String emsg = "Not able translate the targetDataType [" + targetDataType + "] to a Class variable.\n"; + logAndPrint(logger, emsg); + System.exit(1); + } + String cardinality = "SINGLE"; // Default cardinality to SINGLE + + if (targetDataType.equals("Set<String>")) { + cardinality = "SET"; + } + logAndPrint(logger, " ---- NOTE --- about to open graph (takes a little while)\n"); + + graph = AAIGraph.getInstance().getGraph(); + if (graph == null) { + String emsg = "Not able to get a graph object in SchemaMod.java\n"; + logAndPrint(logger, emsg); + System.exit(1); + } + + // Make sure this property is in the DB. + graphMgt = graph.openManagement(); + if (graphMgt == null) { + String emsg = "Not able to get a graph Management object in SchemaMod.java\n"; + logAndPrint(logger, emsg); + System.exit(1); + } + PropertyKey origPropKey = graphMgt.getPropertyKey(propName); + if (origPropKey == null) { + String emsg = "The propName = [" + propName + "] is not defined in our graph. "; + logAndPrint(logger, emsg); + System.exit(1); + } + + if (targetIndexInfo.equals("uniqueIndex")) { + // Make sure the data in the property being changed can have a + // unique-index put on it. + // Ie. if there are duplicate values, we will not be able to + // migrate the data back into the property. + Boolean foundDupesFlag = UniquePropertyCheck.runTheCheckForUniqueness(TRANSID, FROMAPPID, + graph.newTransaction(), propName, logger); + if (foundDupesFlag) { + logAndPrint(logger, + "\n\n!!!!!! >> Cannot add a uniqueIndex for the property: [" + propName + + "] because duplicate values were found. See the log for details on which" + + " nodes have this value. \nThey will need to be resolved (by updating those values to new" + + " values or deleting unneeded nodes) using the standard REST-API \n"); + System.exit(1); + } + } + + // -------------- If we made it to here - we must be OK with making + // this change ------------ + + // Rename this property to a backup name (old name with "retired_" + // appended plus a dateStr) + + SimpleDateFormat d = new SimpleDateFormat("MMddHHmm"); + d.setTimeZone(TimeZone.getTimeZone("GMT")); + String dteStr = d.format(new Date()).toString(); + String retiredName = propName + "-" + dteStr + "-RETIRED"; + graphMgt.changeName(origPropKey, retiredName); + + // Create a new property using the original property name and the + // targetDataType + PropertyKey freshPropKey = graphMgt.makePropertyKey(propName).dataType(dType) + .cardinality(Cardinality.valueOf(cardinality)).make(); + + // Create the appropriate index (if any) + if (targetIndexInfo.equals("uniqueIndex")) { + String freshIndexName = propName + dteStr; + graphMgt.buildIndex(freshIndexName, Vertex.class).addKey(freshPropKey).unique().buildCompositeIndex(); + } else if (targetIndexInfo.equals("index")) { + String freshIndexName = propName + dteStr; + graphMgt.buildIndex(freshIndexName, Vertex.class).addKey(freshPropKey).buildCompositeIndex(); + } + + logAndPrint(logger, "Committing schema changes with graphMgt.commit()"); + graphMgt.commit(); + graph.tx().commit(); + + // Get A new graph object + logAndPrint(logger, " ---- NOTE --- about to open a second graph object (takes a little while)\n"); + + // For each node that has this property, update the new from the old + // and then remove the + // old property from that node + Iterable<?> verts = null; + verts = graph.query().has(retiredName).vertices(); + Iterator<?> it = verts.iterator(); + int vtxCount = 0; + ArrayList<String> alreadySeenVals = new ArrayList<String>(); + while (it.hasNext()) { + vtxCount++; + TitanVertex tmpVtx = (TitanVertex) it.next(); + String tmpVid = tmpVtx.id().toString(); + + Object origVal = tmpVtx.<Object> property(retiredName).orElse(null); + if (preserveData) { + tmpVtx.property(propName, origVal); + if (targetIndexInfo.equals("uniqueIndex")) { + // We're working on a property that is being used as a + // unique index + String origValStr = ""; + if (origVal != null) { + origValStr = origVal.toString(); + } + if (alreadySeenVals.contains(origValStr)) { + // This property is supposed to be unique, but we've + // already seen this value in this loop + // This should have been caught up in the first part + // of SchemaMod, but since it wasn't, we + // will just log the problem. + logAndPrint(logger, + "\n\n ---------- ERROR - could not migrate the old data [" + origValStr + + "] for propertyName [" + propName + + "] because this property is having a unique index put on it."); + showPropertiesAndEdges(TRANSID, FROMAPPID, tmpVtx, logger); + logAndPrint(logger, "-----------------------------------\n"); + } else { + // Ok to add this prop in as a unique value + tmpVtx.property(propName, origVal); + logAndPrint(logger, + "INFO -- just did the add of the freshPropertyKey and updated it with the orig value (" + + origValStr + ")"); + } + alreadySeenVals.add(origValStr); + } else { + // We are not working with a unique index + tmpVtx.property(propName, origVal); + logAndPrint(logger, + "INFO -- just did the add of the freshPropertyKey and updated it with the orig value (" + + origVal.toString() + ")"); + } + } else { + // existing nodes just won't have that property anymore + // Not sure if we'd ever actually want to do this -- maybe + // we'd do this if the new + // data type was not compatible with the old? + } + tmpVtx.property(retiredName).remove(); + + logAndPrint(logger, "INFO -- just did the remove of the " + retiredName + " from this vertex. (vid=" + + tmpVid + ")"); + } + + logAndPrint(logger, "Updated data for " + vtxCount + " vertexes. Now call graph2.commit(). "); + graph.tx().commit(); + } catch (Exception ex) { + logAndPrint(logger, "Threw a regular Exception: "); + logAndPrint(logger, ex.getMessage()); + } finally { + if (graphMgt != null && graphMgt.isOpen()) { + // Any changes that worked correctly should have already done + // their commits. + graphMgt.rollback(); + } + if (graph != null) { + // Any changes that worked correctly should have already done + // their commits. + graph.tx().rollback(); + graph.close(); + } + } + + } + + /** + * Show properties and edges. + * + * @param transId the trans id + * @param fromAppId the from app id + * @param tVert the t vert + * @param logger the logger + */ + private static void showPropertiesAndEdges(String transId, String fromAppId, TitanVertex tVert, EELFLogger logger) { + + if (tVert == null) { + logAndPrint(logger, "Null node passed to showPropertiesAndEdges."); + } else { + String nodeType = ""; + Object ob = tVert.<String> property("aai-node-type"); + if (ob == null) { + nodeType = "null"; + } else { + nodeType = ob.toString(); + } + + logAndPrint(logger, " AAINodeType/VtxID for this Node = [" + nodeType + "/" + tVert.id() + "]"); + logAndPrint(logger, " Property Detail: "); + Iterator<VertexProperty<Object>> pI = tVert.properties(); + while (pI.hasNext()) { + VertexProperty<Object> tp = pI.next(); + Object val = tp.value(); + logAndPrint(logger, "Prop: [" + tp.key() + "], val = [" + val + "] "); + } + + Iterator<Edge> eI = tVert.edges(Direction.BOTH); + if (!eI.hasNext()) { + logAndPrint(logger, "No edges were found for this vertex. "); + } + while (eI.hasNext()) { + TitanEdge ed = (TitanEdge) eI.next(); + String lab = ed.label(); + TitanVertex vtx = (TitanVertex) ed.otherVertex(tVert); + if (vtx == null) { + logAndPrint(logger, + " >>> COULD NOT FIND VERTEX on the other side of this edge edgeId = " + ed.id() + " <<< "); + } else { + String nType = vtx.<String> property("aai-node-type").orElse(null); + String vid = vtx.id().toString(); + logAndPrint(logger, "Found an edge (" + lab + ") from this vertex to a [" + nType + + "] node with VtxId = " + vid); + } + } + } + } // End of showPropertiesAndEdges() + + /** + * Log and print. + * + * @param logger the logger + * @param msg the msg + */ + protected static void logAndPrint(EELFLogger logger, String msg) { + System.out.println(msg); + logger.info(msg); + } + +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/dbgen/UpdateEdgeTags.java b/aai-resources/src/main/java/org/openecomp/aai/dbgen/UpdateEdgeTags.java new file mode 100644 index 0000000..c2ebf6f --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/dbgen/UpdateEdgeTags.java @@ -0,0 +1,380 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.UUID; + +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Vertex; + +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.dbmodel.DbEdgeRules; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.logging.ErrorLogHelper; +import org.openecomp.aai.serialization.db.EdgeRule; +import org.openecomp.aai.serialization.db.EdgeRules; +import org.openecomp.aai.util.AAIConfig; +import com.thinkaurelius.titan.core.TitanEdge; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanTransaction; +import com.thinkaurelius.titan.core.TitanVertex; + + + +public class UpdateEdgeTags { + + private static final String FROMAPPID = "AAI-DB"; + private static final String TRANSID = UUID.randomUUID().toString(); + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + + if( args == null || args.length != 1 ){ + String msg = "usage: UpdateEdgeTags edgeRuleKey (edgeRuleKey can be either, all, or a rule key like 'nodeTypeA|nodeTypeB') \n"; + System.out.println(msg); + System.exit(1); + } + String edgeRuleKeyVal = args[0]; + + TitanGraph graph = null; + + HashMap <String,Object> edgeRuleHash = new HashMap <String,Object>(); + HashMap <String,Object> edgeRulesFullHash = new HashMap <String,Object>(); + HashMap <String,Object> edgeRuleLabelToKeyHash = new HashMap <String,Object>(); + ArrayList <String> labelMapsToMultipleKeys = new <String> ArrayList (); + + int tagCount = DbEdgeRules.EdgeInfoMap.size(); + // Loop through all the edge-rules make sure they look right and + // collect info about which labels support duplicate ruleKeys. + Iterator<String> edgeRulesIterator = DbEdgeRules.EdgeRules.keySet().iterator(); + while( edgeRulesIterator.hasNext() ){ + String ruleKey = edgeRulesIterator.next(); + Collection <String> edRuleColl = DbEdgeRules.EdgeRules.get(ruleKey); + Iterator <String> ruleItr = edRuleColl.iterator(); + if( ruleItr.hasNext() ){ + // For now, we only look for one type of edge between two nodes. + String fullRuleString = ruleItr.next(); + edgeRulesFullHash.put(ruleKey,fullRuleString); + // An EdgeRule is comma-separated and the first item is the edgeLabel + String [] rules = fullRuleString.split(","); + //System.out.println( "rules.length = " + rules.length + ", tagCount = " + tagCount ); + if( rules.length != tagCount ){ + String detail = "Bad EdgeRule data (itemCount=" + rules.length + ") for key = [" + ruleKey + "]."; + System.out.println(detail); + System.exit(0); + } + String edgeLabel = rules[0]; + if( edgeRuleLabelToKeyHash.containsKey(edgeLabel) ){ + // This label maps to more than one edge rule - we'll have to figure out + // which rule applies when we look at each edge that uses this label. + // So we take it out of mapping hash and add it to the list of ones that + // we'll need to look up later. + edgeRuleLabelToKeyHash.remove(edgeLabel); + labelMapsToMultipleKeys.add(edgeLabel); + } + else { + edgeRuleLabelToKeyHash.put(edgeLabel, ruleKey); + } + } + } + + if( ! edgeRuleKeyVal.equals( "all" ) ){ + // If they passed in a (non-"all") argument, that is the single edgeRule that they want to update. + // Note - the key looks like "nodeA|nodeB" as it appears in DbEdgeRules.EdgeRules + Collection <String> edRuleColl = DbEdgeRules.EdgeRules.get(edgeRuleKeyVal); + Iterator <String> ruleItr = edRuleColl.iterator(); + if( ruleItr.hasNext() ){ + // For now, we only look for one type of edge between two nodes (Ie. for one key). + String edRule = ruleItr.next(); + edgeRuleHash.put(edgeRuleKeyVal, edRule); + System.out.println("Adding this rule to list of rules to do: key = " + edgeRuleKeyVal + ", rule = [" + edRule + "]"); + } + else { + String msg = " Error - Unrecognized edgeRuleKey: [" + edgeRuleKeyVal + "]. "; + System.out.println(msg); + System.exit(0); + } + } + else { + // They didn't pass a target ruleKey in, so we'll work on all types of edges + edgeRuleHash.putAll(edgeRulesFullHash); + } + + try { + AAIConfig.init(); + System.out.println(" ---- NOTE --- about to open graph (takes a little while)--------\n"); + ErrorLogHelper.loadProperties(); + + graph = AAIGraph.getInstance().getGraph(); + + if( graph == null ){ + String emsg = "null graph object in updateEdgeTags() \n"; + System.out.println(emsg); + System.exit(0); + } + } + catch (AAIException e1) { + String msg = e1.getErrorObject().toString(); + System.out.println(msg); + System.exit(0); + } + catch (Exception e2) { + String msg = e2.toString(); + System.out.println(msg); + e2.printStackTrace(); + System.exit(0); + } + + TitanTransaction g = graph.newTransaction(); + try { + Iterable <?> edges = graph.query().edges(); + Iterator <?> edgeItr = edges.iterator(); + + // Loop through all edges and update their tags if they are a type we are interested in. + // Sorry about looping over everything, but for now, I can't find a way to just select one type of edge at a time...!? + StringBuffer sb; + boolean missingEdge = false; + while( edgeItr != null && edgeItr.hasNext() ){ + TitanEdge tmpEd = (TitanEdge) edgeItr.next(); + String edLab = tmpEd.label().toString(); + + // Since we have edgeLabels that can be used for different pairs of node-types, we have to + // look to see what nodeTypes this edge is connecting (if it is a label that could do this). + String derivedEdgeKey = ""; + if( labelMapsToMultipleKeys.contains(edLab) ){ + // need to figure out which key is right for this edge + derivedEdgeKey = deriveEdgeRuleKeyForThisEdge( TRANSID, FROMAPPID, g, tmpEd ); + } + else { + // This kind of label only maps to one key -- so we can just look it up. + if ( edgeRuleLabelToKeyHash.get(edLab) == null ) { + if ( !missingEdge ) { + System.out.print("DEBUG - missing edge(s) in edgeRuleLabelToKeyHash " + edgeRuleLabelToKeyHash.toString()); + missingEdge = true; + } + sb = new StringBuffer(); + Vertex vIn = null; + Vertex vOut = null; + Object obj = null; + vIn = tmpEd.vertex(Direction.IN); + if ( vIn != null ){ + obj = vIn.<String>property("aai-node-type").orElse(null); + if ( obj != null ) { + sb.append("from node-type " + obj.toString()); + + obj = vIn.id(); + sb.append(" id " + obj.toString()); + } else { + sb.append(" missing from node-type "); + } + } else { + sb.append(" missing inbound vertex "); + } + vOut = tmpEd.vertex(Direction.OUT); + if ( vOut != null ) { + obj = vOut.<String>property("aai-node-type").orElse(null); + if ( obj != null ) { + sb.append(" to node-type " + obj.toString()); + obj = vOut.id(); + sb.append(" id " + obj.toString()); + } else { + sb.append(" missing to node-type "); + } + } else { + sb.append(" missing to vertex "); + } + System.out.println("DEBUG - null entry for [" + edLab + "] between " + sb.toString()); + continue; + } + derivedEdgeKey = edgeRuleLabelToKeyHash.get(edLab).toString(); + } + + if( edgeRuleHash.containsKey(derivedEdgeKey) ){ + // this is an edge that we want to update + System.out.print("DEBUG - key = " + derivedEdgeKey + ", label = " + edLab + + ", for id = " + tmpEd.id().toString() + ", set: "); + Map<String,EdgeRule> edgeRules = getEdgeTagPropPutHash(TRANSID, FROMAPPID, derivedEdgeKey); + for (String key : edgeRules.keySet()) { + if (tmpEd.label().equals(key)) { + EdgeRules.getInstance().addProperties(tmpEd, edgeRules.get(key)); + } + } + System.out.print("\n"); + } + } // End of looping over all edges + graph.tx().commit(); + System.out.println("DEBUG - committed updates for listed edges " ); + } + catch (Exception e2) { + String msg = e2.toString(); + System.out.println(msg); + e2.printStackTrace(); + if( graph != null ){ + graph.tx().rollback(); + } + System.exit(0); + } + + System.exit(0); + + }// end of main() + + + /** + * Derive edge rule key for this edge. + * + * @param transId the trans id + * @param fromAppId the from app id + * @param graph the graph + * @param tEdge the t edge + * @return String - key to look up edgeRule (fromNodeType|toNodeType) + * @throws AAIException the AAI exception + */ + public static String deriveEdgeRuleKeyForThisEdge( String transId, String fromAppId, TitanTransaction graph, + TitanEdge tEdge ) throws AAIException{ + + TitanVertex fromVtx = tEdge.outVertex(); + TitanVertex toVtx = tEdge.inVertex(); + String startNodeType = fromVtx.<String>property("aai-node-type").orElse(null); + String targetNodeType = toVtx.<String>property("aai-node-type").orElse(null); + String key = startNodeType + "|" + targetNodeType; + if( EdgeRules.getInstance().hasEdgeRule(startNodeType, targetNodeType) ){ + // We can use the node info in the order they were given + return( key ); + } + else { + key = targetNodeType + "|" + startNodeType; + if( EdgeRules.getInstance().hasEdgeRule(targetNodeType, startNodeType) ){ + return( key ); + } + else { + // Couldn't find a rule for this edge + throw new AAIException("AAI_6120", "No EdgeRule found for passed nodeTypes: " + startNodeType + ", " + + targetNodeType); + } + } + }// end of deriveEdgeRuleKeyForThisEdge() + + /** + * Gets the edge tag prop put hash 4 rule. + * + * @param transId the trans id + * @param fromAppId the from app id + * @param edRule the ed rule + * @return the edge tag prop put hash 4 rule + * @throws AAIException the AAI exception + */ + public static HashMap <String,Object> getEdgeTagPropPutHash4Rule( String transId, String fromAppId, String edRule ) + throws AAIException{ + // For a given edgeRule - already pulled out of DbEdgeRules.EdgeRules -- parse out the "tags" that + // need to be set for this kind of edge. + // These are the Boolean properties like, "isParent", "usesResource" etc. + HashMap <String,Object> retEdgePropPutMap = new HashMap <String,Object>(); + + if( (edRule == null) || edRule.equals("") ){ + // No edge rule found for this + throw new AAIException("AAI_6120", "blank edRule passed to getEdgeTagPropPutHash4Rule()"); + } + + int tagCount = DbEdgeRules.EdgeInfoMap.size(); + String [] rules = edRule.split(","); + if( rules.length != tagCount ){ + throw new AAIException("AAI_6121", "Bad EdgeRule data (itemCount =" + rules.length + ") for rule = [" + edRule + "]."); + } + + // In DbEdgeRules.EdgeRules -- What we have as "edRule" is a comma-delimited set of strings. + // The first item is the edgeLabel. + // The second in the list is always "direction" which is always OUT for the way we've implemented it. + // Items starting at "firstTagIndex" and up are all assumed to be booleans that map according to + // tags as defined in EdgeInfoMap. + // Note - if they are tagged as 'reverse', that means they get the tag name with "-REV" on it + for( int i = DbEdgeRules.firstTagIndex; i < tagCount; i++ ){ + String booleanStr = rules[i]; + Integer mapKey = new Integer(i); + String propName = DbEdgeRules.EdgeInfoMap.get(mapKey); + String revPropName = propName + "-REV"; + + if( booleanStr.equals("true") ){ + retEdgePropPutMap.put(propName, true); + retEdgePropPutMap.put(revPropName,false); + } + else if( booleanStr.equals("false") ){ + retEdgePropPutMap.put(propName, false); + retEdgePropPutMap.put(revPropName,false); + } + else if( booleanStr.equals("reverse") ){ + retEdgePropPutMap.put(propName, false); + retEdgePropPutMap.put(revPropName,true); + } + else { + throw new AAIException("AAI_6121", "Bad EdgeRule data for rule = [" + edRule + "], val = [" + booleanStr + "]."); + } + + } + + return retEdgePropPutMap; + + } // End of getEdgeTagPropPutHash() + + + /** + * Gets the edge tag prop put hash. + * + * @param transId the trans id + * @param fromAppId the from app id + * @param edgeRuleKey the edge rule key + * @return the edge tag prop put hash + * @throws AAIException the AAI exception + */ + public static Map<String, EdgeRule> getEdgeTagPropPutHash( String transId, String fromAppId, String edgeRuleKey ) + throws AAIException{ + // For a given edgeRuleKey (nodeTypeA|nodeTypeB), look up the rule that goes with it in + // DbEdgeRules.EdgeRules and parse out the "tags" that need to be set on each edge. + // These are the Boolean properties like, "isParent", "usesResource" etc. + // Note - this code is also used by the updateEdgeTags.java code + + String[] edgeRuleKeys = edgeRuleKey.split("\\|"); + + if (edgeRuleKeys.length < 2 || ! EdgeRules.getInstance().hasEdgeRule(edgeRuleKeys[0], edgeRuleKeys[1])) { + throw new AAIException("AAI_6120", "Could not find an DbEdgeRule entry for passed edgeRuleKey (nodeTypeA|nodeTypeB): " + edgeRuleKey + "."); + } + + Map<String, EdgeRule> edgeRules = EdgeRules.getInstance().getEdgeRules(edgeRuleKeys[0], edgeRuleKeys[1]); + + return edgeRules; + + } // End of getEdgeTagPropPutHash() + + + +} + + + diff --git a/aai-resources/src/main/java/org/openecomp/aai/dmaap/AAIDmaapEventJMSConsumer.java b/aai-resources/src/main/java/org/openecomp/aai/dmaap/AAIDmaapEventJMSConsumer.java index fc11e5d..c016bb1 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/dmaap/AAIDmaapEventJMSConsumer.java +++ b/aai-resources/src/main/java/org/openecomp/aai/dmaap/AAIDmaapEventJMSConsumer.java @@ -126,7 +126,7 @@ public class AAIDmaapEventJMSConsumer implements MessageListener { //String aaiEvent = ""; //String eventName = ""; - + //String environment = ""; //if (message instanceof TextMessage) { diff --git a/aai-resources/src/main/java/org/openecomp/aai/migration/EventAction.java b/aai-resources/src/main/java/org/openecomp/aai/migration/EventAction.java new file mode 100644 index 0000000..82b7cad --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/migration/EventAction.java @@ -0,0 +1,27 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.migration; + +public enum EventAction { + CREATE, + UPDATE, + DELETE +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/migration/NotificationHelper.java b/aai-resources/src/main/java/org/openecomp/aai/migration/NotificationHelper.java new file mode 100644 index 0000000..b956705 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/migration/NotificationHelper.java @@ -0,0 +1,103 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.migration; + +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.util.HashMap; +import java.util.List; + +import javax.ws.rs.core.Response.Status; + +import org.apache.tinkerpop.gremlin.structure.Vertex; + +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.introspection.Introspector; +import org.openecomp.aai.introspection.Loader; +import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; +import org.openecomp.aai.rest.ueb.UEBNotification; +import org.openecomp.aai.serialization.db.DBSerializer; +import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +import org.openecomp.aai.serialization.engines.query.QueryEngine; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + +public class NotificationHelper { + + private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(NotificationHelper.class); + protected final DBSerializer serializer; + protected final Loader loader; + protected final TransactionalGraphEngine engine; + protected final String transactionId; + protected final String sourceOfTruth; + protected final UEBNotification notification; + + public NotificationHelper(Loader loader, DBSerializer serializer, TransactionalGraphEngine engine, String transactionId, String sourceOfTruth) { + this.loader = loader; + this.serializer = serializer; + this.engine = engine; + this.transactionId = transactionId; + this.sourceOfTruth = sourceOfTruth; + this.notification = new UEBNotification(loader); + } + + public void addEvent(Vertex v, Introspector obj, EventAction action, URI uri) throws UnsupportedEncodingException, AAIException { + HashMap<String, Introspector> relatedObjects = new HashMap<>(); + Status status = mapAction(action); + if (!obj.isTopLevel()) { + relatedObjects = this.getRelatedObjects(serializer, engine.getQueryEngine(), v); + } + notification.createNotificationEvent(transactionId, sourceOfTruth, status, uri, obj, relatedObjects); + + } + + private HashMap<String, Introspector> getRelatedObjects(DBSerializer serializer, QueryEngine queryEngine, Vertex v) throws AAIException { + HashMap<String, Introspector> relatedVertices = new HashMap<>(); + List<Vertex> vertexChain = queryEngine.findParents(v); + for (Vertex vertex : vertexChain) { + try { + final Introspector vertexObj = serializer.getVertexProperties(vertex); + relatedVertices.put(vertexObj.getObjectId(), vertexObj); + } catch (AAIUnknownObjectException | UnsupportedEncodingException e) { + LOGGER.warn("Unable to get vertex properties, partial list of related vertices returned"); + } + + } + + return relatedVertices; + } + + private Status mapAction(EventAction action) { + if (EventAction.CREATE.equals(action)) { + return Status.CREATED; + } else if (EventAction.UPDATE.equals(action)) { + return Status.OK; + } else if (EventAction.DELETE.equals(action)) { + return Status.NO_CONTENT; + } else { + return Status.OK; + } + } + + public void triggerEvents() throws AAIException { + notification.triggerEvents(); + } +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/migration/VertexMerge.java b/aai-resources/src/main/java/org/openecomp/aai/migration/VertexMerge.java new file mode 100644 index 0000000..6bb17a9 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/migration/VertexMerge.java @@ -0,0 +1,245 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.migration; + +import java.io.UnsupportedEncodingException; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Vertex; + +import org.openecomp.aai.db.props.AAIProperties; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.introspection.Introspector; +import org.openecomp.aai.introspection.Loader; +import org.openecomp.aai.introspection.exceptions.AAIUnknownObjectException; +import org.openecomp.aai.serialization.db.DBSerializer; +import org.openecomp.aai.serialization.db.EdgeRules; +import org.openecomp.aai.serialization.db.EdgeType; +import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; + +/** + * This class recursively merges two vertices passed in. + * <br> + * You can start with any two vertices, but after the vertices are merged based off the equality of their keys + * + */ +public class VertexMerge { + + private final EELFLogger logger = EELFManager.getInstance().getLogger(this.getClass().getSimpleName()); + + private final GraphTraversalSource g; + private final TransactionalGraphEngine engine; + private final DBSerializer serializer; + private final EdgeRules rules; + private final Loader loader; + private final NotificationHelper notificationHelper; + private final boolean hasNotifications; + private VertexMerge(Builder builder) { + this.engine = builder.getEngine(); + this.serializer = builder.getSerializer(); + this.g = engine.asAdmin().getTraversalSource(); + this.rules = EdgeRules.getInstance(); + this.loader = builder.getLoader(); + this.notificationHelper = builder.getHelper(); + this.hasNotifications = builder.isHasNotifications(); + } + + /** + * Merges vertices. forceCopy is a map of the form [{aai-node-type}:{set of properties}] + * @param primary + * @param secondary + * @param forceCopy + * @throws AAIException + * @throws UnsupportedEncodingException + */ + public void performMerge(Vertex primary, Vertex secondary, Map<String, Set<String>> forceCopy) throws AAIException, UnsupportedEncodingException { + final Optional<Introspector> secondarySnapshot; + if (this.hasNotifications) { + secondarySnapshot = Optional.of(serializer.getLatestVersionView(secondary)); + } else { + secondarySnapshot = Optional.empty(); + } + mergeProperties(primary, secondary, forceCopy); + + Collection<Vertex> secondaryChildren = this.engine.getQueryEngine().findChildren(secondary); + Collection<Vertex> primaryChildren = this.engine.getQueryEngine().findChildren(primary); + + mergeChildren(primary, secondary, primaryChildren, secondaryChildren, forceCopy); + + Collection<Vertex> secondaryCousins = this.engine.getQueryEngine().findCousinVertices(secondary); + Collection<Vertex> primaryCousins = this.engine.getQueryEngine().findCousinVertices(primary); + + secondaryCousins.removeAll(primaryCousins); + logger.info("removing vertex after merge: " + secondary ); + if (this.hasNotifications && secondarySnapshot.isPresent()) { + this.notificationHelper.addEvent(secondary, secondarySnapshot.get(), EventAction.DELETE, this.serializer.getURIForVertex(secondary, false)); + } + secondary.remove(); + for (Vertex v : secondaryCousins) { + this.rules.addEdgeIfPossible(g, v, primary); + } + if (this.hasNotifications) { + final Introspector primarySnapshot = serializer.getLatestVersionView(primary); + this.notificationHelper.addEvent(primary, primarySnapshot, EventAction.UPDATE, this.serializer.getURIForVertex(primary, false)); + } + } + + /** + * This method may go away if we choose to event on each modification performed + * @param primary + * @param secondary + * @param forceCopy + * @throws AAIException + * @throws UnsupportedEncodingException + */ + protected void performMergeHelper(Vertex primary, Vertex secondary, Map<String, Set<String>> forceCopy) throws AAIException, UnsupportedEncodingException { + mergeProperties(primary, secondary, forceCopy); + + Collection<Vertex> secondaryChildren = this.engine.getQueryEngine().findChildren(secondary); + Collection<Vertex> primaryChildren = this.engine.getQueryEngine().findChildren(primary); + + mergeChildren(primary, secondary, primaryChildren, secondaryChildren, forceCopy); + + Collection<Vertex> secondaryCousins = this.engine.getQueryEngine().findCousinVertices(secondary); + Collection<Vertex> primaryCousins = this.engine.getQueryEngine().findCousinVertices(primary); + + secondaryCousins.removeAll(primaryCousins); + secondary.remove(); + for (Vertex v : secondaryCousins) { + this.rules.addEdgeIfPossible(g, v, primary); + } + } + + private String getURI(Vertex v) throws UnsupportedEncodingException, AAIException { + Introspector obj = loader.introspectorFromName(v.<String>property(AAIProperties.NODE_TYPE).orElse("")); + this.serializer.dbToObject(Collections.singletonList(v), obj, 0, true, "false"); + return obj.getURI(); + + } + private void mergeChildren(Vertex primary, Vertex secondary, Collection<Vertex> primaryChildren, Collection<Vertex> secondaryChildren, Map<String, Set<String>> forceCopy) throws UnsupportedEncodingException, AAIException { + Map<String, Vertex> primaryMap = uriMap(primaryChildren); + Map<String, Vertex> secondaryMap = uriMap(secondaryChildren); + Set<String> primaryKeys = new HashSet<>(primaryMap.keySet()); + Set<String> secondaryKeys = new HashSet<>(secondaryMap.keySet()); + primaryKeys.retainAll(secondaryKeys); + final Set<String> mergeItems = new HashSet<>(primaryKeys); + primaryKeys = new HashSet<>(primaryMap.keySet()); + secondaryKeys = new HashSet<>(secondaryMap.keySet()); + secondaryKeys.removeAll(primaryKeys); + final Set<String> copyItems = new HashSet<>(secondaryKeys); + + for (String key : mergeItems) { + this.performMergeHelper(primaryMap.get(key), secondaryMap.get(key), forceCopy); + } + + for (String key : copyItems) { + this.rules.addTreeEdgeIfPossible(g, secondaryMap.get(key), primary); + this.serializer.getEdgeBetween(EdgeType.TREE, secondary, secondaryMap.get(key)).remove(); + } + + } + + private Map<String, Vertex> uriMap(Collection<Vertex> vertices) throws UnsupportedEncodingException, AAIException { + final Map<String, Vertex> result = new HashMap<>(); + for (Vertex v : vertices) { + result.put(getURI(v), v); + } + return result; + } + + private void mergeProperties(Vertex primary, Vertex secondary, Map<String, Set<String>> forceCopy) throws AAIUnknownObjectException { + final String primaryType = primary.<String>property(AAIProperties.NODE_TYPE).orElse(""); + final String secondaryType = secondary.<String>property(AAIProperties.NODE_TYPE).orElse(""); + + final Introspector secondaryObj = loader.introspectorFromName(secondaryType); + secondary.properties().forEachRemaining(prop -> { + if (!primary.property(prop.key()).isPresent() || forceCopy.getOrDefault(primaryType, new HashSet<String>()).contains(prop.key())) { + primary.property(prop.key(), prop.value()); + } + if (primary.property(prop.key()).isPresent() && secondary.property(prop.key()).isPresent() && secondaryObj.isListType(prop.key())) { + mergeCollection(primary, prop.key(), secondary.values(prop.key())); + } + }); + } + private void mergeCollection(Vertex primary, String propName, Iterator<Object> secondaryValues) { + secondaryValues.forEachRemaining(item -> { + primary.property(propName, item); + }); + } + + + public static class Builder { + private final TransactionalGraphEngine engine; + + private final DBSerializer serializer; + private final Loader loader; + private NotificationHelper helper = null; + private boolean hasNotifications = false; + public Builder(Loader loader, TransactionalGraphEngine engine, DBSerializer serializer) { + this.loader = loader; + this.engine = engine; + this.serializer = serializer; + } + + public Builder addNotifications(NotificationHelper helper) { + this.helper = helper; + this.hasNotifications = true; + return this; + } + + + public VertexMerge build() { + return new VertexMerge(this); + } + + protected TransactionalGraphEngine getEngine() { + return engine; + } + + protected DBSerializer getSerializer() { + return serializer; + } + + protected Loader getLoader() { + return loader; + } + + protected NotificationHelper getHelper() { + return helper; + } + + protected boolean isHasNotifications() { + return hasNotifications; + } + + } + +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java b/aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java index 7af432d..ca5fc33 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java +++ b/aai-resources/src/main/java/org/openecomp/aai/rest/LegacyMoxyConsumer.java @@ -140,6 +140,7 @@ public class LegacyMoxyConsumer extends RESTAPI { dbEngine = httpEntry.getDbEngine(); URI uriObject = UriBuilder.fromPath(uri).build(); + this.validateURI(uriObject); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); @@ -421,7 +422,8 @@ public class LegacyMoxyConsumer extends RESTAPI { throw new AAIException("AAI_3102", "You must supply a relationship"); } URI uriObject = UriBuilder.fromPath(uri).build(); - + this.validateURI(uriObject); + QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); Introspector wrappedEntity = loader.unmarshal("relationship", content, org.openecomp.aai.restcore.MediaType.getEnum(this.getInputMediaType(inputMediaType))); @@ -524,7 +526,6 @@ public class LegacyMoxyConsumer extends RESTAPI { Boolean success = true; try { - validateRequest(info); version = Version.valueOf(versionParam); @@ -533,7 +534,7 @@ public class LegacyMoxyConsumer extends RESTAPI { loader = httpEntry.getLoader(); dbEngine = httpEntry.getDbEngine(); URI uriObject = UriBuilder.fromPath(uri).build(); - + this.validateURI(uriObject); QueryParser uriQuery = dbEngine.getQueryBuilder().createQueryFromURI(uriObject); String objName = uriQuery.getResultType(); if (content.length() == 0) { @@ -580,4 +581,14 @@ public class LegacyMoxyConsumer extends RESTAPI { return response; } + private void validateURI(URI uri) throws AAIException { + if (hasRelatedTo(uri)) { + throw new AAIException("AAI_3010"); + } + } + private boolean hasRelatedTo(URI uri) { + + return uri.toString().contains("/" + RestTokens.COUSIN + "/"); + + } } diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/RestTokens.java b/aai-resources/src/main/java/org/openecomp/aai/rest/RestTokens.java new file mode 100644 index 0000000..13bfe65 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/rest/RestTokens.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.rest; + +public enum RestTokens { + + COUSIN("related-to"); + private final String name; + + private RestTokens(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/retired/V7V8Models.java b/aai-resources/src/main/java/org/openecomp/aai/rest/retired/V7V8Models.java new file mode 100644 index 0000000..3eb53da --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/rest/retired/V7V8Models.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.rest.retired; + +import javax.ws.rs.Path; + +@Path("{version: v[78]}/service-design-and-creation/models") +public class V7V8Models extends RetiredConsumer { + +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/retired/V7V8NamedQueries.java b/aai-resources/src/main/java/org/openecomp/aai/rest/retired/V7V8NamedQueries.java new file mode 100644 index 0000000..3f022a2 --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/rest/retired/V7V8NamedQueries.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.rest.retired; + +import javax.ws.rs.Path; + +@Path("{version: v[78]}/service-design-and-creation/named-queries") +public class V7V8NamedQueries extends RetiredConsumer { + +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/ueb/NotificationEvent.java b/aai-resources/src/main/java/org/openecomp/aai/rest/ueb/NotificationEvent.java index 389d296..e473e9d 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/rest/ueb/NotificationEvent.java +++ b/aai-resources/src/main/java/org/openecomp/aai/rest/ueb/NotificationEvent.java @@ -31,12 +31,13 @@ import org.openecomp.aai.util.StoreNotificationEvent; */ public class NotificationEvent { - private Loader loader = null; + private final Loader loader; - private Introspector eventHeader = null; - - private Introspector obj = null; + private final Introspector eventHeader; + private final Introspector obj; + private final String transactionId; + private final String sourceOfTruth; /** * Instantiates a new notification event. * @@ -44,10 +45,12 @@ public class NotificationEvent { * @param eventHeader the event header * @param obj the obj */ - public NotificationEvent (Loader loader, Introspector eventHeader, Introspector obj) { + public NotificationEvent (Loader loader, Introspector eventHeader, Introspector obj, String transactionId, String sourceOfTruth) { this.loader = loader; this.eventHeader = eventHeader; this.obj = obj; + this.transactionId = transactionId; + this.sourceOfTruth = sourceOfTruth; } /** @@ -57,7 +60,7 @@ public class NotificationEvent { */ public void trigger() throws AAIException { - StoreNotificationEvent sne = new StoreNotificationEvent(); + StoreNotificationEvent sne = new StoreNotificationEvent(transactionId, sourceOfTruth); sne.storeEvent(loader, eventHeader, obj); diff --git a/aai-resources/src/main/java/org/openecomp/aai/rest/ueb/UEBNotification.java b/aai-resources/src/main/java/org/openecomp/aai/rest/ueb/UEBNotification.java index 397082f..8cb16e1 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/rest/ueb/UEBNotification.java +++ b/aai-resources/src/main/java/org/openecomp/aai/rest/ueb/UEBNotification.java @@ -50,7 +50,6 @@ public class UEBNotification { private Loader currentVersionLoader = null; protected List<NotificationEvent> events = null; - private String urlBase = null; private Version notificationVersion = null; /** @@ -61,7 +60,6 @@ public class UEBNotification { public UEBNotification(Loader loader) { events = new ArrayList<>(); currentVersionLoader = LoaderFactory.createLoaderForVersion(loader.getModelType(), AAIProperties.LATEST); - urlBase = AAIConfig.get("aai.server.url.base",""); notificationVersion = Version.valueOf(AAIConfig.get("aai.notification.current.version","v10")); } @@ -78,7 +76,7 @@ public class UEBNotification { * @throws IllegalArgumentException the illegal argument exception * @throws UnsupportedEncodingException the unsupported encoding exception */ - public void createNotificationEvent(String transactionId, String sourceOfTruth, Status status, URI uri, Introspector obj, HashMap<String, Introspector> relatedObjects) throws AAIException, IllegalArgumentException, UnsupportedEncodingException { + public void createNotificationEvent(String transactionId, String sourceOfTruth, Status status, URI uri, Introspector obj, HashMap<String, Introspector> relatedObjects) throws AAIException, UnsupportedEncodingException { String action = "UPDATE"; @@ -96,9 +94,9 @@ public class UEBNotification { String entityLink = ""; if (uri.toString().startsWith("/")) { - entityLink = urlBase + notificationVersion + uri; + entityLink = "/aai/" + notificationVersion + uri; } else { - entityLink = urlBase + notificationVersion + "/" + uri; + entityLink = "/aai/" + notificationVersion + "/" + uri; } @@ -148,7 +146,7 @@ public class UEBNotification { } } - final NotificationEvent event = new NotificationEvent(currentVersionLoader, eventHeader, eventObject); + final NotificationEvent event = new NotificationEvent(currentVersionLoader, eventHeader, eventObject, transactionId, sourceOfTruth); events.add(event); } catch (AAIUnknownObjectException e) { throw new RuntimeException("Fatal error - notification-event-header object not found!"); diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/DataConversionHelper.java b/aai-resources/src/main/java/org/openecomp/aai/util/DataConversionHelper.java new file mode 100644 index 0000000..c1d601d --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/util/DataConversionHelper.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.util; + + +/** + * Utility to convert data from one form to another + * + */ +public class DataConversionHelper { + + public static final String IPVERSION_IPV4 = "ipv4"; + public static final String IPVERSION_IPV6 = "ipv6"; + public static final String IPVERSION_UNKNOWN = "unknown"; + + /** + * Instantiates a new data conversion helper. + */ + public DataConversionHelper() { } + + /** + * Convert from 4 or 6 to ipv4 or ipv6. Returns unknown if 4 or 6 not passed. + * @param numVal expects good input but won't error if that's not what's passed + * @return IPVERSION constant, . + * @see org.openecomp.aai.domain.yang.IpVersion + */ + public static String convertIPVersionNumToString(String numVal) { + if ("4".equals(numVal)) return IPVERSION_IPV4; + else if ("6".equals(numVal))return IPVERSION_IPV6; + else return IPVERSION_UNKNOWN; + } + + /** + * Convert from ipv4 or ipv6 to 4 or 6. Returns 0 on bad input. + * @param stringVal expects good input but won't error if that's not what's passed + * @return 4 or 6, or 0 if a bad string is sent. + * @see org.openecomp.aai.domain.yang.IpVersion + */ + public static String convertIPVersionStringToNum(String stringVal) { + if (IPVERSION_IPV4.equals(stringVal)) return "4"; + else if (IPVERSION_IPV6.equals(stringVal)) return "6"; + else return "0"; + } + +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/DeleteResource.java b/aai-resources/src/main/java/org/openecomp/aai/util/DeleteResource.java index 81ee621..5e60c5c 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/util/DeleteResource.java +++ b/aai-resources/src/main/java/org/openecomp/aai/util/DeleteResource.java @@ -41,7 +41,7 @@ import com.google.common.base.CaseFormat; public class DeleteResource { - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(DeleteResource.class); + private static EELFLogger LOGGER; private static final String FROMAPPID = "AAI-TOOLS"; private static final String TRANSID = UUID.randomUUID().toString(); // the logic below to parse the url is dependent on the node types @@ -64,7 +64,7 @@ public class DeleteResource { Properties props = System.getProperties(); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_DELTOOL_LOGBACK_PROPS); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); - + LOGGER = EELFManager.getInstance().getLogger(DeleteResource.class); String url = null; try { if ((args.length < 1) || ((args.length > 1) )) { @@ -113,8 +113,12 @@ public class DeleteResource { String resourceClass = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, resource); resourceClass = "org.openecomp.aai.domain.yang." + resourceClass; - LOGGER.debug("class=" + resourceClass); - LOGGER.debug("path=" + path); + String dMsg = "class=" + resourceClass; + System.out.println(dMsg); + LOGGER.debug(dMsg); + dMsg = "path=" + path; + System.out.println(dMsg); + LOGGER.debug(dMsg); if (bResVersionEnabled) { @@ -127,7 +131,9 @@ public class DeleteResource { { RestController.<T>Get(t, FROMAPPID, TRANSID, path, restObj, false); t = restObj.get(); - LOGGER.info(" GET resoruceversion succeeded\n"); + String infMsg = " GET resoruceversion succeeded\n"; + System.out.println(infMsg); + LOGGER.info(infMsg); String resourceUpdateVersion = GetResourceVersion(t); path += "?resource-version=" + resourceUpdateVersion; } catch (AAIException e) { @@ -150,12 +156,14 @@ public class DeleteResource { String confirm = s.next(); if (!confirm.equalsIgnoreCase("y")) { - LOGGER.info("User chose to exit before deleting"); + String infMsg = "User chose to exit before deleting"; + System.out.println(infMsg); + LOGGER.info(infMsg); System.exit(1); } RestController.Delete(FROMAPPID, TRANSID, path); - + s.close(); System.exit(0); diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/GetResource.java b/aai-resources/src/main/java/org/openecomp/aai/util/GetResource.java index f16efb3..a0a3297 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/util/GetResource.java +++ b/aai-resources/src/main/java/org/openecomp/aai/util/GetResource.java @@ -36,7 +36,7 @@ import com.sun.jersey.api.client.ClientResponse; public class GetResource { - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(GetResource.class); + private static EELFLogger LOGGER; private static final String FROMAPPID = "AAI-TOOLS"; private static final String TRANSID = UUID.randomUUID().toString(); private static final String USAGE_STRING = "Usage: getTool.sh <resource-path> \n + " @@ -53,7 +53,7 @@ public class GetResource { Properties props = System.getProperties(); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_GETRES_LOGBACK_PROPS); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); - + LOGGER = EELFManager.getInstance().getLogger(GetResource.class); String url = null; try { if (args.length < 1) { @@ -66,16 +66,23 @@ public class GetResource { url = args[0].replaceFirst("^/", ""); url = AAIConfig.get(AAIConstants.AAI_SERVER_URL) + url; - LOGGER.debug("url=" + url); + String dmsg = "url=" + url; + LOGGER.debug( dmsg ); + System.out.println( dmsg ); + getNode(url); System.exit(0); } } catch (AAIException e) { - LOGGER.error("GET failed: " + e.getMessage()); + String emsg = "GET failed: " + e.getMessage(); + System.out.println(emsg); + LOGGER.error(emsg); ErrorLogHelper.logException(e); System.exit(1); } catch (Exception e) { - LOGGER.error("GET failed: " + e.getMessage()); + String emsg = "GET failed: " + e.getMessage(); + System.out.println(emsg); + LOGGER.error(emsg); ErrorLogHelper.logError("AAI_7402", e.getMessage()); System.exit(1); } @@ -113,8 +120,10 @@ public class GetResource { .get(ClientResponse.class); if (cres.getStatus() == 404) { // resource not found - LOGGER.info("\nResource does not exist: " + cres.getStatus() - + ":" + cres.getEntity(String.class)); + String infmsg = "\nResource does not exist: " + cres.getStatus() + + ":" + cres.getEntity(String.class); + System.out.println(infmsg); + LOGGER.info(infmsg); throw new AAIException("AAI_7404", "Resource does not exist"); } else if (cres.getStatus() == 200){ String msg = cres.getEntity(String.class); @@ -122,10 +131,13 @@ public class GetResource { Object json = mapper.readValue(msg, Object.class); String indented = mapper.writerWithDefaultPrettyPrinter() .writeValueAsString(json); + System.out.println(indented); LOGGER.info(indented); } else { - LOGGER.error("Getting the Resource failed: " + cres.getStatus() - + ":\n" + cres.getEntity(String.class)); + String emsg = "Getting the Resource failed: " + cres.getStatus() + + ":\n" + cres.getEntity(String.class); + System.out.println(emsg); + LOGGER.error(emsg); throw new AAIException("AAI_7402", "Error during GET"); } } catch (AAIException e) { diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java b/aai-resources/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java index 89562f7..000ebd0 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java +++ b/aai-resources/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java @@ -176,4 +176,62 @@ public class HttpsAuthClient{ } + + public static Client getClient() throws KeyManagementException { + + ClientConfig config = new DefaultClientConfig(); + config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); + config.getClasses().add(org.openecomp.aai.restcore.CustomJacksonJaxBJsonProvider.class); + + SSLContext ctx = null; + try { + String truststore_path = AAIConstants.AAI_HOME_ETC_AUTH + AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_FILENAME); + String truststore_password = AAIConfig.get(AAIConstants.AAI_TRUSTSTORE_PASSWD); + String keystore_path = AAIConstants.AAI_HOME_ETC_AUTH + AAIConfig.get(AAIConstants.AAI_KEYSTORE_FILENAME); + String keystore_password = AAIConfig.get(AAIConstants.AAI_KEYSTORE_PASSWD); + + System.setProperty("javax.net.ssl.trustStore", truststore_path); + System.setProperty("javax.net.ssl.trustStorePassword", truststore_password); + HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){ + public boolean verify(String string,SSLSession ssls) { + return true; + } + }); + + ctx = SSLContext.getInstance("TLSv1.2"); + KeyManagerFactory kmf = null; + try { + kmf = KeyManagerFactory.getInstance("SunX509"); + FileInputStream fin = new FileInputStream(keystore_path); + KeyStore ks = KeyStore.getInstance("PKCS12"); + char[] pwd = keystore_password.toCharArray(); + ks.load(fin, pwd); + kmf.init(ks, pwd); + } catch (Exception e) { + System.out.println("Error setting up kmf: exiting"); + e.printStackTrace(); + System.exit(1); + } + + ctx.init(kmf.getKeyManagers(), null, null); + config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, + new HTTPSProperties( new HostnameVerifier() { + @Override + public boolean verify( String s, SSLSession sslSession ) { + return true; + } + }, ctx)); + } catch (Exception e) { + System.out.println("Error setting up config: exiting"); + e.printStackTrace(); + System.exit(1); + } + + Client client = Client.create(config); + // uncomment this line to get more logging for the request/response + // client.addFilter(new LoggingFilter(System.out)); + + return client; + } + } diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java b/aai-resources/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java new file mode 100644 index 0000000..befa59c --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java @@ -0,0 +1,99 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.util; + +import org.apache.commons.cli.BasicParser; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.eclipse.jetty.util.security.Password; + +import org.openecomp.aai.exceptions.AAIException; + +/* + * The purpose of this class is to be a tool for + * manually applying jetty obfuscation/deobfuscation + * so that one can obfuscate the various passwords/secrets + * in aaiconfig.properties. + * + * Originally, they were being encrypted by a similar + * command line utility, however the encryption key + * was being hardcoded in the src package + * which is a security violation. + * Since this ultimately just moved the problem of how + * to hide secrets to a different secret in a different file, + * and since that encryption was really just being done to + * obfuscate those values in case someone needed to look at + * properties with others looking at their screen, + * we decided that jetty obfuscation would be adequate + * for that task as well as + * removing the "turtles all the way down" secret-to-hide- + * the-secret-to-hide-the-secret problem. + */ +public class JettyObfuscationConversionCommandLineUtil { + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args){ + Options options = new Options(); + options.addOption("e", true, "obfuscate the given string"); + options.addOption("d", true, "deobfuscate the given string"); + + CommandLineParser parser = new BasicParser(); + + try { + CommandLine cmd = parser.parse(options, args); + String toProcess = null; + + if (cmd.hasOption("e")){ + toProcess = cmd.getOptionValue("e"); + String encoded = Password.obfuscate(toProcess); + System.out.println(encoded); + } else if (cmd.hasOption("d")) { + toProcess = cmd.getOptionValue("d"); + String decoded_str = Password.deobfuscate(toProcess); + System.out.println(decoded_str); + } else { + usage(); + } + } catch (ParseException e) { + System.out.println("failed to parse input"); + System.out.println(e.toString()); + usage(); + } catch (Exception e) { + System.out.println("exception:" + e.toString()); + } + } + + /** + * Usage. + */ + private static void usage(){ + System.out.println("usage:");; + System.out.println("-e [string] to obfuscate"); + System.out.println("-d [string] to deobfuscate"); + System.out.println("-h help"); + } +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/PostResource.java b/aai-resources/src/main/java/org/openecomp/aai/util/PostResource.java index 72fcd86..1caeb09 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/util/PostResource.java +++ b/aai-resources/src/main/java/org/openecomp/aai/util/PostResource.java @@ -41,7 +41,7 @@ import com.google.common.base.CaseFormat; */ public class PostResource { - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(PostResource.class); + private static EELFLogger LOGGER; private static final String FROMAPPID = "AAI-TOOLS"; private static final String TRANSID = UUID.randomUUID().toString(); private static final String USAGE_STRING = "Usage: postTool.sh <resource-path> <filename>\n" + @@ -61,7 +61,7 @@ public class PostResource { Properties props = System.getProperties(); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_POSTTOOL_LOGBACK_PROPS); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); - + LOGGER = EELFManager.getInstance().getLogger(PostResource.class); try { if (args.length < 2) { System.out.println("Insufficient arguments"); @@ -85,8 +85,13 @@ public class PostResource { System.exit(1); } - LOGGER.debug("class=" + resourceClass); - LOGGER.debug("path=" + path); + String dMsg = "class=" + resourceClass; + System.out.println(dMsg); + LOGGER.debug(dMsg); + + dMsg = "path=" + path; + System.out.println(dMsg); + LOGGER.debug(dMsg); @SuppressWarnings("unchecked") T resJson1 = (T)readJsonFile(Class.forName(resourceClass), args[1]); @@ -95,9 +100,17 @@ public class PostResource { ObjectMapper mapper = new ObjectMapper(); Object json = mapper.readValue(response, Object.class); - LOGGER.info(" POST succeeded\n"); - LOGGER.info("Response = " + mapper.writer().withDefaultPrettyPrinter().writeValueAsString(json)); - LOGGER.info("\nDone!!"); + String infMsg = " POST succeeded\n"; + System.out.println(infMsg); + LOGGER.info(infMsg); + + infMsg = "Response = " + mapper.writer().withDefaultPrettyPrinter().writeValueAsString(json); + System.out.println(infMsg); + LOGGER.info(infMsg); + + infMsg = "\nDone!!"; + System.out.println(infMsg); + LOGGER.info(infMsg); System.exit(0); diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/PutResource.java b/aai-resources/src/main/java/org/openecomp/aai/util/PutResource.java index 70fccb1..b4275b7 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/util/PutResource.java +++ b/aai-resources/src/main/java/org/openecomp/aai/util/PutResource.java @@ -48,7 +48,7 @@ import com.sun.jersey.api.client.ClientResponse; */ public class PutResource { - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(PutResource.class); + private static EELFLogger LOGGER; private static final String FROMAPPID = "AAI-TOOLS"; private static final String TRANSID = UUID.randomUUID().toString(); private static final String USAGE_STRING = "Usage: putTool.sh <resource-path> <filename> <UpdatingRelationshiplist> <UpdatingChild> <ChildNameList> <SkipIfExists>\n" + @@ -74,7 +74,7 @@ public class PutResource { Properties props = System.getProperties(); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_PUTTOOL_LOGBACK_PROPS); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); - + LOGGER = EELFManager.getInstance().getLogger(PutResource.class); Boolean bResVersionEnabled = false; try @@ -144,16 +144,21 @@ public class PutResource { LOGGER.debug("url=" + url); if ( nodeExists( url) ) { - LOGGER.info("PUT succeeded, the resource exists already in the DB. Skipping the put based on the skipIfExists command line parameter.\n"); - System.exit(0); + String infMsg ="PUT succeeded, the resource exists already in the DB. Skipping the put based on the skipIfExists command line parameter.\n"; + System.out.println(infMsg); + LOGGER.info(infMsg); + System.exit(0); } - } RestController.<T>Get(t2, FROMAPPID, TRANSID, path, restObj, false); t2 = restObj.get(); - LOGGER.info(" GET succeeded\n"); + String infMsg = " GET succeeded\n"; + System.out.println(infMsg); + LOGGER.info(infMsg); + } catch (AAIException e) { - if ( !doPutIfExists ) { + if ( !doPutIfExists ) { + System.out.println("Warning - Caught exception while attempting to PUT resource"); LOGGER.warn("Caught exception while attempting to PUT resource", e); } bExist = false; @@ -161,6 +166,7 @@ public class PutResource { catch (Exception e1) { if ( !doPutIfExists ) { + System.out.println("Warning - GET exception ignored with skipExists parameter\n"); LOGGER.warn(" GET exception ignored with skipExists parameter\n", e1); } bExist = false; @@ -177,17 +183,24 @@ public class PutResource { String DBresourceVersion = GetResourceVersion(t2); if ( !doPutIfExists ) { - LOGGER.info("PUT succeeded, the resource exists already in the DB. Skipping the put based on the skipIfExists command line parameter.\n"); - System.exit(0); + String infMsg = "PUT succeeded, the resource exists already in the DB. Skipping the put based on the skipIfExists command line parameter.\n"; + System.out.println(infMsg); + LOGGER.info(infMsg); + System.exit(0); } if (resourceUpdateVersion == null || resourceUpdateVersion.isEmpty()) { - if ( DBresourceVersion != null && !DBresourceVersion.isEmpty()) - LOGGER.error("The resource with version = " + DBresourceVersion + " exists already in the DB. Please supply the right resourceVersion in input data file.\n"); - else - LOGGER.error("The resource exists already in the DB. Please supply the right resourceVersion in input data file.\n"); - + if ( DBresourceVersion != null && !DBresourceVersion.isEmpty()){ + String eMsg = "The resource with version = " + DBresourceVersion + " exists already in the DB. Please supply the right resourceVersion in input data file.\n"; + System.out.println(eMsg); + LOGGER.error(eMsg); + } + else{ + String eMsg = "The resource exists already in the DB. Please supply the right resourceVersion in input data file.\n"; + System.out.println(eMsg); + LOGGER.error(eMsg); + } System.exit(1); } @@ -196,7 +209,9 @@ public class PutResource { if ( resourceUpdateVersion != null && !resourceUpdateVersion.isEmpty() ) if (!DBresourceVersion.equals(resourceUpdateVersion)) { - LOGGER.error("DB version doesn't match current version. Please get the latest version and modify.\n"); + String eMsg = "DB version doesn't match current version. Please get the latest version and modify.\n"; + System.out.println(eMsg); + LOGGER.error(eMsg); System.exit(1); } } @@ -205,8 +220,10 @@ public class PutResource { { if ( bResVersionEnabled && resourceUpdateVersion != null && !resourceUpdateVersion.isEmpty()) { - LOGGER.error("DB doesn't have this resource any more. Please create a new version by taking out the resourceVersion tag from your input resource data file.\n"); - System.exit(1); + String eMsg = "DB doesn't have this resource any more. Please create a new version by taking out the resourceVersion tag from your input resource data file.\n"; + System.out.println(eMsg); + LOGGER.error(eMsg); + System.exit(1); } } @@ -247,8 +264,12 @@ public class PutResource { RestController.<T>Put(resJson1, FROMAPPID, TRANSID, path, false); - LOGGER.info(" PUT succeeded"); - LOGGER.info("Done!!"); + String infMsg = " PUT succeeded"; + System.out.println(infMsg); + LOGGER.info(infMsg); + infMsg = "Done!!"; + System.out.println(infMsg); + LOGGER.info(infMsg); System.exit(0); @@ -256,8 +277,13 @@ public class PutResource { if ( !doPutIfExists ) { // ignore 412 failure if ( e.getMessage().equals("AAI_7116") ) { if ( e.getMessage().indexOf("status=412") > 0) { - LOGGER.info("PUT succeeded, return 412 ignored\n"); - LOGGER.info("\nDone!!"); + String infMsg = "PUT succeeded, return 412 ignored\n"; + System.out.println(infMsg); + LOGGER.info(infMsg); + + infMsg = "\nDone!!"; + System.out.println(infMsg); + LOGGER.info(infMsg); System.exit(0); } } @@ -383,12 +409,14 @@ public class PutResource { client = HttpsAuthClient.getTwoWaySSLClient(); } - LOGGER.info("Getting the resource...: " + url); - + String infMsg = "Getting the resource...: " + url; + System.out.println(infMsg); + LOGGER.info(infMsg); + ClientResponse cres = client.resource(url) .header("X-TransactionId", TRANSID) .header("X-FromAppId", FROMAPPID) - .header("Authorization", HttpsAuthClient.getBasicAuthHeaderValue()) + .header("Authorization", HttpsAuthClient.getBasicAuthHeaderValue()) .accept("application/json") .get(ClientResponse.class); @@ -398,9 +426,11 @@ public class PutResource { } else if (cres.getStatus() == 200){ return true; } else { - LOGGER.error("Getting the Resource failed: " + cres.getStatus() - + ": " + cres.getEntity(String.class)); - return false; + String eMsg = "Getting the Resource failed: " + cres.getStatus() + + ": " + cres.getEntity(String.class); + System.out.println(eMsg); + LOGGER.error(eMsg); + return false; } } catch (KeyManagementException e) { throw new AAIException("AAI_7401", e, "Error during GET"); diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/RelationshipPutDel.java b/aai-resources/src/main/java/org/openecomp/aai/util/RelationshipPutDel.java new file mode 100644 index 0000000..a6a21ca --- /dev/null +++ b/aai-resources/src/main/java/org/openecomp/aai/util/RelationshipPutDel.java @@ -0,0 +1,211 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.util; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.security.KeyManagementException; +import java.util.Properties; +import java.util.UUID; + +import org.openecomp.aai.domain.yang.Relationship; +import org.openecomp.aai.exceptions.AAIException; +import com.att.eelf.configuration.Configuration; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; + + +public class RelationshipPutDel { + + private static final String FROMAPPID = "AAI-TOOLS"; + private static final String TRANSID = UUID.randomUUID().toString(); + private static EELFLogger LOGGER; + private static final String USAGE_STRING = "Usage: rshipTool.sh <PUT|DELETE> <resource-path> <filename>\n" + + "resource-path for a particular resource starting after the aai/<version>, relationship-list/relationship gets added by script\n" + + "filename is the path to a file which contains the json input for the relationship payload" + + "for example: relTool.sh PUT cloud-infrastructure/oam-networks/oam-network/test-100-oam /tmp/putrship.json\n"; + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + + // Set the logging file properties to be used by EELFManager + Properties props = System.getProperties(); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_RSHIPTOOL_LOGBACK_PROPS); + props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); + LOGGER = EELFManager.getInstance().getLogger(RelationshipPutDel.class); + String dMsg = "Start processing..."; + System.out.println(dMsg); + LOGGER.debug(dMsg); + + String rshipURL, resURL = null; + Relationship rship = null; + + try { + if ((args.length < 3) || (!args[0].equalsIgnoreCase("PUT") && !args[0].equalsIgnoreCase("DELETE"))) { + System.out.println("Insufficient or Invalid arguments"); + System.out.println(USAGE_STRING); + System.exit(1); + } + + rship = readJsonFile(args[2]); + + // Assume the config AAI_SERVER_URL has a last slash so remove if + // resource-path has it as the first char + resURL = args[1].replaceFirst("^/", ""); + resURL = AAIConfig.get(AAIConstants.AAI_SERVER_URL) + resURL; + rshipURL = resURL.concat("/relationship-list/relationship"); + + dMsg = "Resource URL=" + rshipURL; + System.out.println(dMsg); + LOGGER.debug(dMsg); + + PutDelRelationship(rshipURL, rship, args[0]); + + String infMsg = args[0] + " Relationship succeeded to: " + rship.getRelatedTo() + "\n"; + System.out.println(infMsg); + LOGGER.info(infMsg); + + GetResource.getNode(resURL); + infMsg = "Done!!"; + System.out.println(infMsg); + LOGGER.info(infMsg); + + System.exit(0); + + } catch (AAIException e) { + LOGGER.error(args[0] + " Relationship PUT/DELETE failed", e); + System.out.println(args[0] + " Relationship PUT/DELETE failed"); + System.exit(1); + } catch (Exception e) { + LOGGER.error(args[0] + " Relationship PUT/DELETE failed", e); + System.out.println(args[0] + " Relationship PUT/DELETE failed"); + System.exit(1); + } + } + + /** + * Read json file. + * + * @param fName the f name + * @return the relationship + * @throws AAIException the AAI exception + */ + public static Relationship readJsonFile( String fName ) throws AAIException { + String jsonData = ""; + BufferedReader br = null; + Relationship rship = new Relationship(); + + try { + String line; + br = new BufferedReader(new FileReader(fName)); + while ((line = br.readLine()) != null) { + jsonData += line + "\n"; + } + } catch (IOException e) { + throw new AAIException("AAI_7403", e, "Error opening json file"); + } finally { + try { + if (br != null) + br.close(); + } catch (IOException ex) { + throw new AAIException("AAI_7403", ex, "Error closing json file"); + } + } + + try { + rship = MapperUtil.readWithDashesAsObjectOf(Relationship.class, jsonData); + } + catch (Exception je){ + throw new AAIException("AAI_7403", je, "Error parsing json file"); + } + + return rship; + + }//End readJsonFile() + + + /** + * Put del relationship. + * + * @param aaiLogger the aai logger + * @param logline the logline + * @param rshipURL the rship URL + * @param rship the rship + * @param action the action + * @throws AAIException the AAI exception + */ + public static void PutDelRelationship(String rshipURL, + Relationship rship, + String action) throws AAIException{ + try { + Client client = HttpsAuthClient.getClient(); + ClientResponse cres = null; + + if (action.equalsIgnoreCase("PUT")) + cres = client.resource(rshipURL) + .header("X-TransactionId", TRANSID) + .header("X-FromAppId", FROMAPPID) + .accept("application/json") + .entity(rship) + .put(ClientResponse.class); + else + cres = client.resource(rshipURL) + .header("X-TransactionId", TRANSID) + .header("X-FromAppId", FROMAPPID) + .accept("application/json") + .entity(rship) + .delete(ClientResponse.class); + + if (cres.getStatus() == 404) { // resource not found + String infMsg = "Resource does not exist...: " + cres.getStatus() + + ":\n" + cres.getEntity(String.class); + System.out.println(infMsg); + LOGGER.info(infMsg); + throw new AAIException("AAI_7404", "Resource does not exist"); + } else if ((action.equalsIgnoreCase("PUT") && cres.getStatus() == 200) || + (action.equalsIgnoreCase("DELETE") && cres.getStatus() == 204)) { + String infMsg = action + " Resource status: " + cres.getStatus(); + System.out.println(infMsg); + LOGGER.info(infMsg); + } else { + String eMsg = action + " Resource failed: " + cres.getStatus() + + ":\n" + cres.getEntity(String.class); + System.out.println(eMsg); + LOGGER.error(eMsg); + throw new AAIException("AAI_7402", "Error during PutDel"); + } + } catch (AAIException e) { + throw e; + } catch (KeyManagementException e) { + throw new AAIException("AAI_7401", "Error during PutDel"); + } catch (Exception e) { + throw new AAIException("AAI_7402", "Error during PutDel"); + } + } + +} diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/StoreNotificationEvent.java b/aai-resources/src/main/java/org/openecomp/aai/util/StoreNotificationEvent.java index ea674ed..181627b 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/util/StoreNotificationEvent.java +++ b/aai-resources/src/main/java/org/openecomp/aai/util/StoreNotificationEvent.java @@ -25,20 +25,17 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Iterator; -import java.util.List; -import java.util.Map; import java.util.UUID; import javax.xml.bind.Marshaller; -import org.apache.cxf.helpers.CastUtils; -import org.apache.cxf.message.Message; -import org.apache.cxf.phase.PhaseInterceptorChain; import org.eclipse.persistence.dynamic.DynamicEntity; import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext; import org.json.JSONException; import org.json.JSONObject; + import org.openecomp.aai.dmaap.AAIDmaapEventJMSProducer; +import org.openecomp.aai.domain.notificationEvent.NotificationEvent; import org.openecomp.aai.exceptions.AAIException; import org.openecomp.aai.introspection.Introspector; import org.openecomp.aai.introspection.Loader; @@ -49,31 +46,90 @@ public class StoreNotificationEvent { private AAIDmaapEventJMSProducer messageProducer; private String fromAppId = ""; private String transId = ""; - + private final String transactionId; + private final String sourceOfTruth; /** * Instantiates a new store notification event. */ - public StoreNotificationEvent() { + public StoreNotificationEvent(String transactionId, String sourceOfTruth) { this.messageProducer = new AAIDmaapEventJMSProducer(); - Message inMessage = PhaseInterceptorChain.getCurrentMessage().getExchange().getInMessage(); - Map<String, List<String>> headersList = CastUtils.cast((Map<?, ?>) inMessage.get(Message.PROTOCOL_HEADERS)); - if (headersList != null) { - List<String> xt = headersList.get("X-TransactionId"); - if (xt != null) { - for (String transIdValue : xt) { - transId = transIdValue; - } - } - List<String> fa = headersList.get("X-FromAppId"); - if (fa != null) { - for (String fromAppIdValue : fa) { + this.transactionId = transactionId; + this.sourceOfTruth = sourceOfTruth; + } - fromAppId = fromAppIdValue; - } - } + /** + * Store event. + * + * @param eh + * the eh + * @param obj + * the obj + * @throws AAIException + * the AAI exception + */ + public void storeEvent(NotificationEvent.EventHeader eh, Object obj) throws AAIException { + + if (obj == null) { + throw new AAIException("AAI_7350"); } - } + org.openecomp.aai.domain.notificationEvent.ObjectFactory factory = new org.openecomp.aai.domain.notificationEvent.ObjectFactory(); + + org.openecomp.aai.domain.notificationEvent.NotificationEvent ne = factory.createNotificationEvent(); + + if (eh.getId() == null) { + eh.setId(genDate2() + "-" + UUID.randomUUID().toString()); + } + if (eh.getTimestamp() == null) { + eh.setTimestamp(genDate()); + } + + // there's no default, but i think we want to put this in hbase? + + if (eh.getEntityLink() == null) { + eh.setEntityLink("UNK"); + } + + if (eh.getAction() == null) { + eh.setAction("UNK"); + } + + if (eh.getEventType() == null) { + eh.setEventType(AAIConfig.get("aai.notificationEvent.default.eventType", "UNK")); + } + + if (eh.getDomain() == null) { + eh.setDomain(AAIConfig.get("aai.notificationEvent.default.domain", "UNK")); + } + + if (eh.getSourceName() == null) { + eh.setSourceName(AAIConfig.get("aai.notificationEvent.default.sourceName", "UNK")); + } + + if (eh.getSequenceNumber() == null) { + eh.setSequenceNumber(AAIConfig.get("aai.notificationEvent.default.sequenceNumber", "UNK")); + } + + if (eh.getSeverity() == null) { + eh.setSeverity(AAIConfig.get("aai.notificationEvent.default.severity", "UNK")); + } + + if (eh.getVersion() == null) { + eh.setVersion(AAIConfig.get("aai.notificationEvent.default.version", "UNK")); + } + + ne.setCambriaPartition(AAIConstants.UEB_PUB_PARTITION_AAI); + ne.setEventHeader(eh); + ne.setEntity(obj); + + try { + PojoUtils pu = new PojoUtils(); + String entityJson = pu.getJsonFromObject(ne); + sendToDmaapJmsQueue(entityJson); + } catch (Exception e) { + throw new AAIException("AAI_7350", e); + } + } /** * Store dynamic event. diff --git a/aai-resources/src/main/java/org/openecomp/aai/util/UpdateResource.java b/aai-resources/src/main/java/org/openecomp/aai/util/UpdateResource.java index adecfb1..1597a7b 100644 --- a/aai-resources/src/main/java/org/openecomp/aai/util/UpdateResource.java +++ b/aai-resources/src/main/java/org/openecomp/aai/util/UpdateResource.java @@ -35,7 +35,7 @@ import com.att.eelf.configuration.EELFManager; public class UpdateResource { - private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(UpdateResource.class.getName()); + private static EELFLogger LOGGER; private static final String FROMAPPID = "AAIUPDT"; private static final String TRANSID = UUID.randomUUID().toString(); private static final String UPDATE_URL = "actions/update"; @@ -59,7 +59,7 @@ public class UpdateResource { Properties props = System.getProperties(); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_NAME, AAIConstants.AAI_UPDTOOL_LOGBACK_PROPS); props.setProperty(Configuration.PROPERTY_LOGGING_FILE_PATH, AAIConstants.AAI_HOME_ETC_APP_PROPERTIES); - + LOGGER = EELFManager.getInstance().getLogger(UpdateResource.class.getName()); try { if (args.length < 3) { System.out.println("Nothing to update or Insufficient arguments"); @@ -76,9 +76,11 @@ public class UpdateResource { System.exit(0); } catch (AAIException e) { + System.out.println("Error - Update Failed."); ErrorLogHelper.logException(e); System.exit(1); } catch (Exception e) { + System.out.println("Error - Update Failed." + e.getMessage()); ErrorLogHelper.logError("AAI_7402", "Update failed: " + e.getMessage()); System.exit(1); } @@ -113,10 +115,16 @@ public class UpdateResource { update.getAction().add(action); - LOGGER.info("updating the resource... "); - + String infMsg = "updating the resource... "; + System.out.println(infMsg); + LOGGER.info(infMsg); + RestController.<Update>Put(update, FROMAPPID, TRANSID, UPDATE_URL); - LOGGER.info("Update Successful"); + + infMsg = "Update Successful"; + System.out.println(infMsg); + LOGGER.info(infMsg); + } catch (AAIException e) { throw e; } catch (Exception e) { diff --git a/aai-resources/src/main/scripts/PropertyChangeName.sh b/aai-resources/src/main/scripts/PropertyChangeName.sh new file mode 100644 index 0000000..af61403 --- /dev/null +++ b/aai-resources/src/main/scripts/PropertyChangeName.sh @@ -0,0 +1,83 @@ +#!/bin/ksh + +### +# ============LICENSE_START======================================================= +# org.openecomp.aai +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# +# This script is used to add a target property name with the same value in the database schema +# to a vertex which has an existing property. The existing property is not removed. +# +# Note also - This script just makes changes to the schema that is currently live. +# If you were to create a new schema in a brandy-new environment, it would look like +# whatever the oxm (as of July 2016) told it to look like. So, part of making a +# change to the db schema should Always first be to make the change in the oxm so that +# future environments will have the change. This script is just to change existing +# instances of the schema since schemaGenerator (as of July 2015) does not update things - it +# just does the initial creation. +# +# To use this script, you need to pass four parameters: +# propertyName -- the name of the property that has the value to be used in the targetProperty +# targetPropertyName -- the name of the targetProperty +# targetNodeType -- NA if all propertyName instances in the DB are impacted, otherwise limit the change to this nodeType +# skipCommit -- true or false. For testing, skips the commit when set to true. +# +# Ie. propertyNameChange service-id persona-model-id service-instance true +# + +echo +echo `date` " Starting $0" + + +userid=$( id | cut -f2 -d"(" | cut -f1 -d")" ) +if [ "${userid}" != "aaiadmin" ]; then + echo "You must be aaiadmin to run $0. The id used $userid." + exit 1 +fi + + +if [ "$#" -ne 4 ]; then + echo "Illegal number of parameters" + echo "usage: $0 propertyName targetPropertyName targetNodeType skipCommit" + exit 1 +fi + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources + +for JAR in `ls $PROJECT_HOME/extJars/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +for JAR in `ls $PROJECT_HOME/lib/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +$JAVA_HOME/bin/java -classpath $CLASSPATH -Dhttps.protocols=TLSv1.1,TLSv1.2 -DAJSC_HOME=$PROJECT_HOME -Daai.home=$PROJECT_HOME \ + org.openecomp.aai.dbgen.PropertyNameChange $1 $2 $3 $4 +if [ "$?" -ne "0" ]; then + echo "Problem executing propertyNameChange " + exit 1 +fi + + +echo `date` " Done $0" +exit 0 diff --git a/aai-resources/src/main/scripts/addResourceVersionProperty.sh b/aai-resources/src/main/scripts/addResourceVersionProperty.sh new file mode 100644 index 0000000..821275a --- /dev/null +++ b/aai-resources/src/main/scripts/addResourceVersionProperty.sh @@ -0,0 +1,55 @@ +#!/bin/ksh + +### +# ============LICENSE_START======================================================= +# org.openecomp.aai +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# +# The script invokes the AddResourceVersionProp java class as a one-time (per database instance) migration tool +# which adds the new property "resource-version" to every node in the db. +# + +echo +echo `date` " Starting $0" + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources + +for JAR in `ls $PROJECT_HOME/extJars/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +for JAR in `ls $PROJECT_HOME/lib/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +userid=$( id | cut -f2 -d"(" | cut -f1 -d")" ) +if [ "${userid}" != "aaiadmin" ]; then + echo "You must be aaiadmin to run $0. The id used $userid." + exit 1 +fi + + +$JAVA_HOME/bin/java -classpath $CLASSPATH -Dhttps.protocols=TLSv1.1,TLSv1.2 -DAJSC_HOME=$PROJECT_HOME -Daai.home=$PROJECT_HOME \ + org.openecomp.aai.dbgen.AddResourceVersionProp + +echo `date` " Done $0" +exit 0 diff --git a/aai-resources/src/main/scripts/changePropertyCardinality.sh b/aai-resources/src/main/scripts/changePropertyCardinality.sh new file mode 100644 index 0000000..0eeac6d --- /dev/null +++ b/aai-resources/src/main/scripts/changePropertyCardinality.sh @@ -0,0 +1,88 @@ +#!/bin/ksh + +### +# ============LICENSE_START======================================================= +# org.openecomp.aai +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# +# This script is used to change the cardinality of an existing database property. +# It currently just allows you to change TO a SET cardinality with dataType = String. +# It does not currently let you preserve the data (since we're just doing this for one +# field which nobody uses yet). +# +# Note also - This script just makes changes to the schema that is currently live. +# If you were to create a new schema in a brandy-new environment, it would look like +# whatever ex5.json (as of Jan 2016) told it to look like. So, part of making a +# change to the db schema should Always first be to make the change in ex5.json so that +# future environments will have the change. This script is just to change existing +# instances of the schema since schemaGenerator (as of Jan 2016) does not update things - it +# just does the initial creation. +# +# Boy, this is getting to be a big comment section... +# +# To use this script, you need to pass four parameters: +# propertyName -- the name of the property that you need to change Cardinality on. +# targetDataType -- whether it's changing or not, you need to give it: For now -- we only allow "String" +# targetCardinality -- For now -- only accepts "SET". In the future we should support ("SET", "LIST" or "SINGLE") +# preserveDataFlag -- true or false. For now -- only supports "false" +# +# Ie. changePropertyCardinality.sh supplier-release-list String SET false +# + +echo +echo `date` " Starting $0" + + +userid=$( id | cut -f2 -d"(" | cut -f1 -d")" ) +if [ "${userid}" != "aaiadmin" ]; then + echo "You must be aaiadmin to run $0. The id used $userid." + exit 1 +fi + + +if [ "$#" -ne 4 ]; then + echo "Illegal number of parameters" + echo "usage: $0 propertyName targetDataType targetCardinality preserveDataFlag" + exit 1 +fi + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources + +for JAR in `ls $PROJECT_HOME/extJars/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +for JAR in `ls $PROJECT_HOME/lib/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + + +$JAVA_HOME/bin/java -classpath $CLASSPATH -Dhttps.protocols=TLSv1.1,TLSv1.2 -DAJSC_HOME=$PROJECT_HOME -Daai.home=$PROJECT_HOME \ + org.openecomp.aai.dbgen.ChangePropertyCardinality $1 $2 $3 $4 +if [ "$?" -ne "0" ]; then + echo "Problem executing ChangePropertyCardinality " + exit 1 +fi + + +echo `date` " Done $0" +exit 0 diff --git a/aai-resources/src/main/scripts/createDBSchema.sh b/aai-resources/src/main/scripts/createDBSchema.sh index 51668de..3cdbcd3 100644 --- a/aai-resources/src/main/scripts/createDBSchema.sh +++ b/aai-resources/src/main/scripts/createDBSchema.sh @@ -33,6 +33,7 @@ echo echo `date` " Starting $0" . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` diff --git a/aai-resources/src/main/scripts/deleteTool.sh b/aai-resources/src/main/scripts/deleteTool.sh index 585f333..c91f564 100644 --- a/aai-resources/src/main/scripts/deleteTool.sh +++ b/aai-resources/src/main/scripts/deleteTool.sh @@ -34,6 +34,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/deobfuscatePW.sh b/aai-resources/src/main/scripts/deobfuscatePW.sh index 965525d..0a1f09a 100644 --- a/aai-resources/src/main/scripts/deobfuscatePW.sh +++ b/aai-resources/src/main/scripts/deobfuscatePW.sh @@ -39,6 +39,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/edgeTagger.sh b/aai-resources/src/main/scripts/edgeTagger.sh index 5a120a2..35c214c 100644 --- a/aai-resources/src/main/scripts/edgeTagger.sh +++ b/aai-resources/src/main/scripts/edgeTagger.sh @@ -72,6 +72,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/getTool.sh b/aai-resources/src/main/scripts/getTool.sh index 2da20eb..6f54299 100644 --- a/aai-resources/src/main/scripts/getTool.sh +++ b/aai-resources/src/main/scripts/getTool.sh @@ -34,6 +34,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/notifyTool.sh b/aai-resources/src/main/scripts/notifyTool.sh index 2ecf1f4..9a0eede 100644 --- a/aai-resources/src/main/scripts/notifyTool.sh +++ b/aai-resources/src/main/scripts/notifyTool.sh @@ -34,6 +34,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/postTool.sh b/aai-resources/src/main/scripts/postTool.sh index a773915..9a059e2 100644 --- a/aai-resources/src/main/scripts/postTool.sh +++ b/aai-resources/src/main/scripts/postTool.sh @@ -34,6 +34,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/putTool.sh b/aai-resources/src/main/scripts/putTool.sh index 9d3f1dd..db581f8 100644 --- a/aai-resources/src/main/scripts/putTool.sh +++ b/aai-resources/src/main/scripts/putTool.sh @@ -34,6 +34,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/rshipTool.sh b/aai-resources/src/main/scripts/rshipTool.sh index 316d0f5..5c71f51 100644 --- a/aai-resources/src/main/scripts/rshipTool.sh +++ b/aai-resources/src/main/scripts/rshipTool.sh @@ -43,6 +43,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/run_DbTestProcessBuilder.sh b/aai-resources/src/main/scripts/run_DbTestProcessBuilder.sh new file mode 100644 index 0000000..7cf1c5f --- /dev/null +++ b/aai-resources/src/main/scripts/run_DbTestProcessBuilder.sh @@ -0,0 +1,54 @@ +#!/bin/ksh + +### +# ============LICENSE_START======================================================= +# org.openecomp.aai +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# +# This script invokes the dataSnapshot java class passing an option to tell it to take +# a snapshot of the database and store it as a single-line XML file. +# + +echo +echo `date` " Starting $0" + + +userid=$( id | cut -f2 -d"(" | cut -f1 -d")" ) +if [ "${userid}" != "aaiadmin" ]; then + echo "You must be aaiadmin to run $0. The id used $userid." + exit 1 +fi + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources + +for JAR in `ls $PROJECT_HOME/extJars/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +for JAR in `ls $PROJECT_HOME/lib/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +$JAVA_HOME/bin/java -classpath $CLASSPATH -Dhttps.protocols=TLSv1.1,TLSv1.2 -DAJSC_HOME=$PROJECT_HOME -Daai.home=$PROJECT_HOME org.openecomp.aai.util.DbTestProcessBuilder "$@" + +echo `date` " Done $0" +exit 0 diff --git a/aai-resources/src/main/scripts/run_FixXSD.sh b/aai-resources/src/main/scripts/run_FixXSD.sh new file mode 100644 index 0000000..9293ded --- /dev/null +++ b/aai-resources/src/main/scripts/run_FixXSD.sh @@ -0,0 +1,68 @@ +#!/bin/ksh + +### +# ============LICENSE_START======================================================= +# org.openecomp.aai +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# +# The script invokes GetResource java class to get all nodes +# + +echo +echo `date` " Starting $0" + +REV=$1 +AAIHOME=$2 +echo "AAIHOME: $AAIHOME" + +if test "$REV" = "" +then + REV=v6 +fi + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources + +if test "$AAIHOME" = "" +then + AAIHOME=$PROJECT_HOME +fi + + +for JAR in `ls $AAIHOME/target/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +for JAR in `ls $PROJECT_HOME/lib/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +export REV=$REV +echo "FixXSD $REV $AAIHOME" +$JAVA_HOME/bin/java -classpath $CLASSPATH -DAJSC_HOME=$AAIHOME org.openecomp.aai.util.FixXSDNew $REV +ret_code=$? +if [ $ret_code != 0 ]; then + echo `date` " Done $0" + exit $ret_code +fi + +echo `date` " Done $0" +exit 0 diff --git a/aai-resources/src/main/scripts/schemaMod.sh b/aai-resources/src/main/scripts/schemaMod.sh index f4fd4d5..3204900 100644 --- a/aai-resources/src/main/scripts/schemaMod.sh +++ b/aai-resources/src/main/scripts/schemaMod.sh @@ -66,6 +66,7 @@ if [ "$#" -ne 4 ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/main/scripts/uniquePropertyCheck.sh b/aai-resources/src/main/scripts/uniquePropertyCheck.sh new file mode 100644 index 0000000..cee03b9 --- /dev/null +++ b/aai-resources/src/main/scripts/uniquePropertyCheck.sh @@ -0,0 +1,60 @@ +#!/bin/ksh + +### +# ============LICENSE_START======================================================= +# org.openecomp.aai +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# +# The script invokes UniqueProperty java class to see if the passed property is unique in the db and if +# not, to display where duplicate values are found. +# +# For example: uniquePropertyCheck.sh subscriber-name +# + +echo +echo `date` " Starting $0" + +userid=$( id | cut -f2 -d"(" | cut -f1 -d")" ) +if [ "${userid}" != "aaiadmin" ]; then + echo "You must be aaiadmin to run $0. The id used $userid." + exit 1 +fi + +. /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources + +for JAR in `ls $PROJECT_HOME/extJars/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +for JAR in `ls $PROJECT_HOME/lib/*.jar` +do + CLASSPATH=$CLASSPATH:$JAR +done + +$JAVA_HOME/bin/java -classpath $CLASSPATH -Dhttps.protocols=TLSv1.1,TLSv1.2 -DAJSC_HOME=$PROJECT_HOME -Daai.home=$PROJECT_HOME org.openecomp.aai.util.UniquePropertyCheck "$@" +ret_code=$? +if [ $ret_code != 0 ]; then + echo `date` " Done $0" + exit $ret_code +fi + +echo `date` " Done $0" +exit 0 diff --git a/aai-resources/src/main/scripts/updateTool.sh b/aai-resources/src/main/scripts/updateTool.sh index 25670f6..bdb47e2 100644 --- a/aai-resources/src/main/scripts/updateTool.sh +++ b/aai-resources/src/main/scripts/updateTool.sh @@ -34,6 +34,7 @@ if [ "${userid}" != "aaiadmin" ]; then fi . /etc/profile.d/aai.sh +PROJECT_HOME=/opt/app/aai-resources for JAR in `ls $PROJECT_HOME/extJars/*.jar` do diff --git a/aai-resources/src/test/java/org/openecomp/aai/dbgen/DbMethTest.java b/aai-resources/src/test/java/org/openecomp/aai/dbgen/DbMethTest.java new file mode 100644 index 0000000..420daa7 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/dbgen/DbMethTest.java @@ -0,0 +1,90 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + +import static org.junit.Assert.assertEquals; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +import org.openecomp.aai.exceptions.AAIException; + +public class DbMethTest { + + @Rule + public ExpectedException expectedEx = ExpectedException.none(); + + @Test + public void testGetEdgeTagPropPutHash() throws AAIException { + Map<String, String> expectedMap = new HashMap<>(); + expectedMap.put("usesResource", "false"); + expectedMap.put("isParent", "false"); + expectedMap.put("SVC-INFRA", "true"); + expectedMap.put("hasDelTarget", "false"); + + assertEquals(expectedMap, DbMeth.getEdgeTagPropPutHash("", "", "pserver|complex").get("locatedIn").getEdgeProperties()); + } + + @Test + public void testGetEdgeTagPropPutHash2() throws AAIException { + Map<String, String> expectedMap = new HashMap<>(); + expectedMap.put("usesResource", "false"); + expectedMap.put("isParent", "false"); + expectedMap.put("SVC-INFRA", "false"); + expectedMap.put("hasDelTarget", "false"); + + assertEquals(expectedMap, DbMeth.getEdgeTagPropPutHash("", "", "service-instance|allotted-resource").get("uses").getEdgeProperties()); + } + + @Test + public void testGetEdgeTagPropPutHash3() throws AAIException { + Map<String, String> expectedMap = new HashMap<>(); + expectedMap.put("usesResource", "false"); + expectedMap.put("isParent", "true"); + expectedMap.put("SVC-INFRA", "false"); + expectedMap.put("hasDelTarget", "false"); + + assertEquals(expectedMap, DbMeth.getEdgeTagPropPutHash("", "", "service-instance|allotted-resource").get("has").getEdgeProperties()); + } + + @Ignore + @Test + public void getGetEdgeTagPropPutHashThrowsExceptionWhenNoRuleExists() throws Exception { + expectedEx.expect(AAIException.class); + expectedEx.expectMessage("AAI_6120"); + DbMeth.getEdgeTagPropPutHash("", "", "complex|pserver"); + } + + @Ignore + @Test + public void getGetEdgeTagPropPutHashThrowsExceptionWhenNoRuleExists1() throws Exception { + expectedEx.expect(AAIException.class); + expectedEx.expectMessage("AAI_6120"); + DbMeth.getEdgeTagPropPutHash("", "", "complex"); + } + + +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/dbgen/DbRunTest.java b/aai-resources/src/test/java/org/openecomp/aai/dbgen/DbRunTest.java new file mode 100644 index 0000000..cef8019 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/dbgen/DbRunTest.java @@ -0,0 +1,341 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.dbgen; + +import java.nio.file.attribute.FileTime; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Iterator; + +import org.openecomp.aai.dbmap.AAIGraph; +import org.openecomp.aai.exceptions.AAIException; +import org.openecomp.aai.logging.ErrorLogHelper; +import org.openecomp.aai.util.AAIConfig; +import org.openecomp.aai.util.DbTestGetFileTime; +import com.thinkaurelius.titan.core.TitanTransaction; +import com.thinkaurelius.titan.core.TitanVertex; + +public class DbRunTest { + + /** + * The main method. + * + * @param args the arguments + */ + public static void main(String[] args) { + + String testid = "NA"; + TitanTransaction graph = null; + + boolean runIt = false; + try { + AAIConfig.init(); + ErrorLogHelper.loadProperties(); + if (args.length > 0) { + System.out.println( "DbRunTest called with " + args.length + " arguments"); + + + } else { + System.out.print("usage: DbRunTest <testid> <processDelay milliseconds> <processName> <loopcnt>\n"); + return; + } + } catch (AAIException e) { + System.out.print("Threw a AAIException -- \n"); + System.out.println(e.getMessage()); + } catch (Exception ex) { + System.out.print("Threw a regular ole Exception \n"); + System.out.println(ex.getMessage()); + } + + + + //System.out.println("skipping Titan graph for now..."); + //TitanGraph graph = null; + + + String processName = "NA"; + if ( args.length > 1 ) + processName = args[2].trim(); + + try { + System.out.println(processName + " ---- NOTE --- about to open graph (takes a little while)--------\n"); + + graph = AAIGraph.getInstance().getGraph().newTransaction(); + + if( graph == null ){ + System.out.println(processName + "Error creating Titan graph. \n"); + return; + } + } catch( Exception ex ){ + System.out.println( processName + " ERROR: caught this exception: " + ex ); + return; + } + + testid = args[0].trim(); + runIt = true; + Integer processDelay = new Integer(args[1].trim() ); // delay of write + Integer loopCnt = new Integer(args[3].trim() ); // delay of write + + String path = "NA"; + try { + + path = AAIConfig.get("dbruntest.path" ); // uses file create-timestamp + Integer writeDelay = new Integer(AAIConfig.get("dbruntest.delay" )); // delay seconds from create-timestamp + Integer loopDelay = new Integer(AAIConfig.get("dbruntest.loopdelay" )); // delay seconds from create-timestamp for next loop + + DbTestGetFileTime getFileTime = new DbTestGetFileTime(); + FileTime fileTime = getFileTime.createFileReturnTime( path ); + long createMillis = fileTime.toMillis(); + System.out.println(processName + " delays to use " + writeDelay + " processDelay " + processDelay); + System.out.println(processName + " test control file " + path + " creation time :" + + new SimpleDateFormat("dd/MM/yyyy HH:mm:ss:SSS") + .format(fileTime.toMillis())); + + long delayMillis = writeDelay * 60 * 1000; + long loopMillis = loopDelay * 60 * 1000; + + int loops = loopCnt.intValue(); + + long sleepTime; + for ( int i = 0; i < loops; ++i ) { + + if ( i > 0 ) + delayMillis = loopMillis * i; // to find the time the write will be done + delayMillis += processDelay.intValue(); + + System.out.println(processName + " test control file " + path + " write time :" + + new SimpleDateFormat("dd/MM/yyyy HH:mm:ss:SSS") + .format(createMillis + delayMillis)); + + Calendar now = Calendar.getInstance(); + long myMillis = now.getTimeInMillis(); + System.out.println(processName + " test control file " + path + " current time :" + + new SimpleDateFormat("dd/MM/yyyy HH:mm:ss:SSS") + .format(myMillis)); + // total sleep based on current time, time file was created, and any delay per process + + if ( i == 0 ) + sleepTime = createMillis + delayMillis - myMillis; // + processDelay.intValue() + else + sleepTime = createMillis + ( loopMillis * i ) - myMillis; + sleepTime += processDelay.intValue(); + System.out.println(processName + " sleep " + sleepTime + " current time :" + + new SimpleDateFormat("dd/MM/yyyy HH:mm:ss:SSS") + .format(myMillis)); + Thread.sleep(sleepTime); + + System.out.println(processName + " out of sleep for loop count " + i); + + if (runIt) { + // include loop in unique-id string + runMultiLevelTest(graph, testid + i + "-", processName); + } + + } // end loop + + + } catch ( Exception io ) { + System.out.println( processName + " Exception getting creation time " + path + " message " + io.getMessage()); + io.printStackTrace(); + } + + + + + + if( graph != null && graph.isOpen() ){ + System.out.println(processName + "About to call graph.shutdown()"); + graph.tx().close(); + System.out.println(processName + " -- AFTER call graph.shutdown()"); + } + + System.out.println(processName + " -- Boom!"); + System.exit(0); + + }// end of main() + + + + /** + * Run multi level test. + * + * @param graph the graph + * @param testIdentifier the test identifier + * @param processName the process name + */ + private static void runMultiLevelTest(TitanTransaction graph, String testIdentifier, String processName) { + + try { + String useRollback = AAIConfig.get("dbruntest.rollback"); + + // l3-interface-ipv6-address-list -> vlan -> l-interface -> vnic -> vserver -> tenant + + HashMap<String, Object> propHash7 = new HashMap<String, Object>(); + propHash7.put("tenant-name", testIdentifier + "tenantName"); + propHash7.put("tenant-id", testIdentifier + "tenantId"); + TitanVertex tenantVtx = DbMeth.persistAaiNode("junkTransId", + "testApp", graph, "tenant", propHash7, true, null); + + + HashMap<String, Object> propHash8 = new HashMap<String, Object>(); + propHash8.put("vserver-selflink", testIdentifier + "vserverSelfThing"); + propHash8.put("vserver-id", testIdentifier + "vserverID"); + propHash8.put("vserver-name", testIdentifier + "vserverName"); + propHash8.put("vserver-name2", testIdentifier + "vserverName2"); + TitanVertex vserverVtx = DbMeth.persistAaiNode("junkTransId", + "testApp", graph, "vserver", propHash8, true, tenantVtx); + + HashMap<String, Object> propHash10 = new HashMap<String, Object>(); + propHash10.put("interface-name", testIdentifier + "logIntfOnVpe"); + TitanVertex logIntfVtx = DbMeth.persistAaiNode("junkTransId", + "testApp", graph, "l-interface", propHash10, true, vserverVtx); + + HashMap<String, Object> propHash11 = new HashMap<String, Object>(); + propHash11.put("vlan-interface", testIdentifier + "vlanIntf"); + TitanVertex vlanVtx = DbMeth.persistAaiNode("junkTransId", + "testApp", graph, "vlan", propHash11, true, logIntfVtx); + + HashMap<String, Object> propHash12 = new HashMap<String, Object>(); + propHash12.put("l3-interface-ipv6-address", testIdentifier + "v6 pool"); + TitanVertex l3PoolVtx = DbMeth.persistAaiNode("junkTransId", + "testApp", graph, "l3-interface-ipv6-address-list", propHash12, true, vlanVtx); + + System.out.println(processName + " ---- did the persist on all the nodes -- "); + + DbMeth.persistAaiEdge("junkTransId", "junkApp", graph, vserverVtx, tenantVtx); + DbMeth.persistAaiEdge("junkTransId", "junkApp", graph, logIntfVtx, vserverVtx); + DbMeth.persistAaiEdge("junkTransId", "junkApp", graph, vlanVtx, logIntfVtx); + DbMeth.persistAaiEdge("junkTransId", "junkApp", graph, l3PoolVtx, vlanVtx); + + System.out.println(processName + " ---- persisted all the edges -- "); + + if ( useRollback.toUpperCase().equals("Y")) { + System.out.print(processName + " using rollback for unittesting\n"); + if (graph != null) { + graph.tx().rollback(); + } + } else { + graph.tx().commit(); + System.out.println(processName + " ---- Ran graph.commit() -- "); + } + HashMap<String, Object> propHash0 = new HashMap<String, Object>(); + propHash0.put("l3-interface-ipv6-address-list.l3-interface-ipv6-address", testIdentifier + "v6 pool"); + propHash0.put("tenant.tenant-name", testIdentifier + "tenantName"); + propHash0.put("tenant.tenant-id", testIdentifier + "tenantId"); + propHash0.put("vserver.vserver-selflink", testIdentifier + "vserverSelfThing"); + propHash0.put("vserver.vserver-id", testIdentifier + "vserverID"); + propHash0.put("vserver.vserver-name", testIdentifier + "vserverName"); + propHash0.put("vserver.vserver-name2", testIdentifier + "vserverName2"); + propHash0.put("l-interface.interface-name", testIdentifier + "logIntfOnVpe"); + propHash0.put("vlan.vlan-interface", testIdentifier + "vlanIntf"); + + + System.out.println(processName + " ---- First try the getUniqueNodeWithDepParams trail: "); + + TitanVertex poolV = DbMeth.getUniqueNodeWithDepParams("junkTransId", "junkAppId", graph, "l3-interface-ipv6-address-list", propHash0, null); + + ArrayList <String> retArr = DbMeth.showPropertiesForNode("junkTransId", "junkFromAppId", poolV); + for( String info : retArr ){ System.out.println(info); } + +/* + * RelationshipUtils replaced with RelationshipGraph + * System.out.println(processName + " ---- Next try the figureRelData trail: "); + List <RelationshipData> relDatList = RelationshipUtils.figureRelData("junkTransId", "junkAppId", graph, poolV, ""); + System.out.println(processName + " ---- Looks like it worked ----------"); + Iterator<RelationshipData> iterDat = relDatList.iterator(); + while (iterDat.hasNext()) { + RelationshipData relDat = iterDat.next(); + System.out.println(processName + " relData: key = [" + + relDat.getRelationshipKey() + "], val = [" + + relDat.getRelationshipValue() + "]"); + }*/ + + + HashMap<String, Object> propHash = new HashMap<String, Object>(); + ArrayList<TitanVertex> vertList; + + propHash.put("tenant-id", testIdentifier + "tenantId"); + vertList = DbMeth.getNodes("junkTransId", + "testApp", graph, "tenant", propHash, false, null, true); + + Iterator<TitanVertex> iter = vertList.iterator(); + + int vertexCnt = 0; + while( iter.hasNext() ) { + ++vertexCnt; + TitanVertex tvx = iter.next(); + System.out.println(processName + " Found tenant " + vertexCnt ); + DbMeth.showPropertiesForNode( "junkId", "junkApp", tvx ); + } + if ( vertexCnt == 0 ) + System.out.println(processName + " no tenant found" ); + + propHash = new HashMap<String, Object>(); + + propHash.put("vserver-id", testIdentifier + "vserverID"); + vertList = DbMeth.getNodes("junkTransId", + "testApp", graph, "vserver", propHash, false, null, true); + + iter = vertList.iterator(); + + vertexCnt = 0; + while( iter.hasNext() ) { + ++vertexCnt; + TitanVertex tvx = iter.next(); + System.out.println(processName + " Found vserver " + vertexCnt ); + DbMeth.showPropertiesForNode( "junkId", "junkApp", tvx ); + } + if ( vertexCnt == 0 ) + System.out.println(processName + " no vserver found" ); + + if ( useRollback.toUpperCase().equals("Y")) { + System.out.print(processName + " using rollback for unittesting\n"); + if (graph != null) { + graph.tx().rollback(); + } + } + + } + catch (AAIException e) { + System.out.print(processName + " Threw an AAIException -- calling graph.rollback()\n"); + System.out.println("exMsg = [" + e.getMessage() + "]"); + if (graph != null) { + graph.tx().rollback(); + } + } + catch (Exception ex) { + System.out.print(processName + " Threw a regular ole Exception calling graph.rollback()\n"); + System.out.println(ex.getMessage()); + System.out.println(ex.toString()); + if (graph != null) { + graph.tx().rollback(); + } + } + + + + return; + } + + +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java b/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java new file mode 100644 index 0000000..1b5b67b --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/migration/VertexMergeTest.java @@ -0,0 +1,190 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.migration; + +import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; + +import java.io.UnsupportedEncodingException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import org.openecomp.aai.db.props.AAIProperties; +import org.openecomp.aai.dbmap.DBConnectionType; +import org.openecomp.aai.introspection.Loader; +import org.openecomp.aai.introspection.LoaderFactory; +import org.openecomp.aai.introspection.ModelType; +import org.openecomp.aai.introspection.Version; +import org.openecomp.aai.serialization.db.DBSerializer; +import org.openecomp.aai.serialization.db.EdgeRules; +import org.openecomp.aai.serialization.engines.QueryStyle; +import org.openecomp.aai.serialization.engines.TitanDBEngine; +import org.openecomp.aai.serialization.engines.TransactionalGraphEngine; +//import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; +import org.openecomp.aai.util.AAIConstants; +import com.thinkaurelius.titan.core.Cardinality; +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanTransaction; +import com.thinkaurelius.titan.core.schema.TitanManagement; + +@Ignore +public class VertexMergeTest { + + + private final static Version version = Version.v10; + private final static ModelType introspectorFactoryType = ModelType.MOXY; + private final static QueryStyle queryStyle = QueryStyle.TRAVERSAL; + private final static DBConnectionType type = DBConnectionType.REALTIME; + private static Loader loader; + private static TransactionalGraphEngine dbEngine; + private static TitanGraph graph; + private static EdgeRules rules; + private static GraphTraversalSource g; + private static TitanTransaction tx; + @BeforeClass + public static void setUp() throws NoSuchFieldException, SecurityException, Exception { + graph = TitanFactory.build().set("storage.backend","inmemory").open(); + tx = graph.newTransaction(); + g = tx.traversal(); + System.setProperty("AJSC_HOME", "."); + System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); +// QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/org/openecomp/aai/introspection/"); + loader = LoaderFactory.createLoaderForVersion(introspectorFactoryType, version); + dbEngine = new TitanDBEngine( + queryStyle, + type, + loader); + rules = EdgeRules.getInstance(); + + TitanManagement mgmt = graph.openManagement(); + mgmt.makePropertyKey("test-list").dataType(String.class).cardinality(Cardinality.SET).make(); + mgmt.commit(); + Vertex pserverSkeleton = g.addV().property("aai-node-type", "pserver").property("hostname", "TEST1") + .property("source-of-truth", "AAI-EXTENSIONS").property("fqdn", "test1.com").property("test-list", "value1").next(); + + Vertex pInterface1 = g.addV().property("aai-node-type", "p-interface").property("interface-name", "p-interface1") + .property(AAIProperties.AAI_URI, "/cloud-infrastructure/pservers/pserver/TEST1/p-interfaces/p-interface/p-interface1").next(); + + Vertex pInterface2 = g.addV().property("aai-node-type", "p-interface").property("interface-name", "p-interface2") + .property(AAIProperties.AAI_URI, "/cloud-infrastructure/pservers/pserver/TEST1/p-interfaces/p-interface/p-interface2").next(); + + Vertex pInterface2Secondary = g.addV().property("aai-node-type", "p-interface").property("interface-name", "p-interface2").property("special-prop", "value") + .property(AAIProperties.AAI_URI, "/cloud-infrastructure/pservers/pserver/TEST1/p-interfaces/p-interface/p-interface2").next(); + + Vertex lInterface1 = g.addV().property("aai-node-type", "l-interface").property("interface-name", "l-interface1").property("special-prop", "value") + .property(AAIProperties.AAI_URI, "/cloud-infrastructure/pservers/pserver/TEST1/p-interfaces/p-interface/p-interface2/l-interfaces/l-interface/l-interface1").next(); + + Vertex lInterface1Canopi = g.addV().property("aai-node-type", "l-interface").property("interface-name", "l-interface1") + .property(AAIProperties.AAI_URI, "/cloud-infrastructure/pservers/pserver/TEST1/p-interfaces/p-interface/p-interface2/l-interfaces/l-interface/l-interface1").next(); + + Vertex logicalLink = g.addV().property("aai-node-type", "logical-link").property("link-name", "logical-link1") + .property(AAIProperties.AAI_URI, "/network/logical-links/logical-link/logical-link1").next(); + Vertex pserverCanopi = g.addV().property("aai-node-type", "pserver").property("hostname", "TEST1") + .property("source-of-truth", "CANOPI-WS").property("fqdn", "test2.com").property("test-list", "value2").next(); + + Vertex complex1 = g.addV().property("aai-node-type", "complex").property("physical-location-id", "complex1") + .property("source-of-truth", "RO").next(); + + Vertex complex2 = g.addV().property("aai-node-type", "complex").property("physical-location-id", "complex2") + .property("source-of-truth", "RCT").next(); + + Vertex vserver1 = g.addV().property("aai-node-type", "vserver").property("vserver-id", "vserver1") + .property("source-of-truth", "RO").next(); + + Vertex vserver2 = g.addV().property("aai-node-type", "vserver").property("vserver-id", "vserver2") + .property("source-of-truth", "RCT").next(); + Vertex vserver3 = g.addV().property("aai-node-type", "vserver").property("vserver-id", "vserver3") + .property("source-of-truth", "RCT").next(); + Vertex vserver4 = g.addV().property("aai-node-type", "vserver").property("vserver-id", "vserver4") + .property("source-of-truth", "RCT").next(); + Vertex vserver5 = g.addV().property("aai-node-type", "vserver").property("vserver-id", "vserver5") + .property("source-of-truth", "RCT").next(); + + + rules.addEdge(g, pserverSkeleton, complex1); + rules.addEdge(g, pserverSkeleton, vserver1); + rules.addEdge(g, pserverSkeleton, vserver2); + rules.addTreeEdge(g, pserverSkeleton, pInterface1); + rules.addTreeEdge(g, pserverSkeleton, pInterface2Secondary); + rules.addTreeEdge(g, pInterface2Secondary, lInterface1); + rules.addEdge(g, lInterface1, logicalLink); + rules.addEdge(g, pserverCanopi, complex2); + rules.addEdge(g, pserverCanopi, vserver3); + rules.addEdge(g, pserverCanopi, vserver4); + rules.addEdge(g, pserverCanopi, vserver5); + rules.addTreeEdge(g, pserverCanopi, pInterface2); + rules.addTreeEdge(g, pInterface2, lInterface1Canopi); + + Map<String, Set<String>> forceCopy = new HashMap<>(); + Set<String> forceSet = new HashSet<>(); + forceSet.add("fqdn"); + forceCopy.put("pserver", forceSet); + + TransactionalGraphEngine spy = spy(dbEngine); + TransactionalGraphEngine.Admin adminSpy = spy(dbEngine.asAdmin()); + GraphTraversalSource traversal = g; + GraphTraversalSource readOnly = g; + when(spy.asAdmin()).thenReturn(adminSpy); + when(adminSpy.getTraversalSource()).thenReturn(traversal); + when(adminSpy.getReadOnlyTraversalSource()).thenReturn(readOnly); + DBSerializer serializer = new DBSerializer(version, spy, introspectorFactoryType, "Merge test"); + + VertexMerge merge = new VertexMerge.Builder(loader, spy, serializer).build(); + merge.performMerge(pserverCanopi, pserverSkeleton, forceCopy); + } + @AfterClass + public static void cleanUp() { + tx.rollback(); + graph.close(); + } + + @Test + public void run() throws UnsupportedEncodingException { + + assertEquals("pserver merged", false, g.V().has("hostname", "TEST1").has("source-of-truth", "AAI-EXTENSIONS").hasNext()); + assertThat("pserver list merge", Arrays.asList("value1", "value2"), containsInAnyOrder(g.V().has("hostname", "TEST1").values("test-list").toList().toArray())); + assertEquals("canopi pserver has one edge to vserver2", 1, g.V().has("hostname", "TEST1").both().has("vserver-id", "vserver2").toList().size()); + assertEquals("canopi pserver has one edge to vserver1", 1, g.V().has("hostname", "TEST1").both().has("vserver-id", "vserver1").toList().size()); + assertEquals("canopi pserver retained edge to complex2", true, g.V().has("hostname", "TEST1").both().has("physical-location-id", "complex2").hasNext()); + assertEquals("canopi pserver received forced prop", "test1.com", g.V().has("hostname", "TEST1").values("fqdn").next()); + assertEquals("pserver skeleton child copied", true, g.V().has("hostname", "TEST1").both().has("interface-name", "p-interface1").hasNext()); + assertEquals("pserver skeleton child merged", true, g.V().has("hostname", "TEST1").both().has("interface-name", "p-interface2").has("special-prop", "value").hasNext()); + assertEquals("l-interface child merged", true, g.V().has("hostname", "TEST1").both().has("interface-name", "p-interface2").both().has("interface-name", "l-interface1").has("special-prop", "value").hasNext()); + assertEquals("l-interface child cousin edge merged", true, g.V().has("hostname", "TEST1").both().has("interface-name", "p-interface2").both().has("interface-name", "l-interface1").both().has("link-name", "logical-link1").hasNext()); + assertEquals("one l-interface1 found", new Long(1), g.V().has("interface-name", "l-interface1").count().next()); + assertEquals("one p-interface2 found", new Long(1), g.V().has("interface-name", "p-interface2").count().next()); + + } +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/query/builder/TraversalQueryTest.java b/aai-resources/src/test/java/org/openecomp/aai/query/builder/TraversalQueryTest.java deleted file mode 100644 index 694e99e..0000000 --- a/aai-resources/src/test/java/org/openecomp/aai/query/builder/TraversalQueryTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * org.openecomp.aai - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.aai.query.builder; - -import static org.junit.Assert.assertEquals; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URISyntaxException; - -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; -import org.mockito.Mock; - -import org.openecomp.aai.db.props.AAIProperties; -import org.openecomp.aai.exceptions.AAIException; -import org.openecomp.aai.introspection.Introspector; -import org.openecomp.aai.introspection.Loader; -import org.openecomp.aai.introspection.LoaderFactory; -import org.openecomp.aai.introspection.ModelType; -//import org.openecomp.aai.serialization.queryformats.QueryFormatTestHelper; -import org.openecomp.aai.util.AAIConstants; - -public class TraversalQueryTest { - - public static Loader loader; - @Mock public GraphTraversalSource g; - @BeforeClass - public static void configure() throws NoSuchFieldException, SecurityException, Exception { - - System.setProperty("AJSC_HOME", "."); - System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); -// QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/org/openecomp/aai/introspection/"); - loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, AAIProperties.LATEST); - } - - @Test - public void unionQuery() { - TraversalQuery tQ = new TraversalQuery(loader, g); - TraversalQuery tQ2 = new TraversalQuery(loader, g); - TraversalQuery tQ3 = new TraversalQuery(loader, g); - tQ.union( - tQ2.getVerticesByProperty("test1", "value1"), - tQ3.getVerticesByIndexedProperty("test2", "value2")); - - GraphTraversal<Vertex, Vertex> expected = __.<Vertex>start() - .union(__.has("test1", "value1"),__.has("test2", "value2")); - - assertEquals("they are equal", expected, tQ.getQuery()); - - } - - @Test - @Ignore - public void traversalClones() throws UnsupportedEncodingException, AAIException, URISyntaxException { - TraversalQuery tQ = new TraversalQuery(loader, g); - Introspector test = loader.introspectorFromName("test-object"); - QueryBuilder builder = tQ.createQueryFromURI(new URI("network/test-objects/test-object/key1")).getQueryBuilder(); - GraphTraversal<Vertex, Vertex> expected = __.<Vertex>start().has("vnf-id", "key1").has("aai-node-type", "test-object"); - GraphTraversal<Vertex, Vertex> containerExpected = __.<Vertex>start().has("aai-node-type", "test-object"); - - assertEquals("query object", expected.toString(), builder.getQuery().toString()); - assertEquals("container query object", containerExpected.toString(), builder.getContainerQuery().getQuery().toString()); - - } - - @Test - public void nestedTraversalClones() throws UnsupportedEncodingException, AAIException, URISyntaxException { - - TraversalQuery tQ = new TraversalQuery(loader, g); - QueryBuilder builder = tQ.createQueryFromURI(new URI("network/generic-vnfs/generic-vnf/key1/l-interfaces/l-interface/key2")).getQueryBuilder(); - GraphTraversal<Vertex, Vertex> expected = __.<Vertex>start().has("vnf-id", "key1").has("aai-node-type", "generic-vnf").out("hasLInterface").has(AAIProperties.NODE_TYPE, "l-interface").has("interface-name", "key2"); - GraphTraversal<Vertex, Vertex> containerExpected = __.<Vertex>start().has("vnf-id", "key1").has("aai-node-type", "generic-vnf").out("hasLInterface").has(AAIProperties.NODE_TYPE, "l-interface"); - - assertEquals("query object", expected.toString(), builder.getQuery().toString()); - assertEquals("container query object", containerExpected.toString(), builder.getContainerQuery().getQuery().toString()); - - } - - - -} diff --git a/aai-resources/src/test/java/org/openecomp/aai/schema/db/AuditOXMTest.java b/aai-resources/src/test/java/org/openecomp/aai/schema/db/AuditOXMTest.java index 8188bdd..8e9e322 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/schema/db/AuditOXMTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/schema/db/AuditOXMTest.java @@ -45,7 +45,7 @@ public class AuditOXMTest { */ @BeforeClass public static void before() { - System.setProperty("AJSC_HOME", "./src/test/resources/");; + System.setProperty("AJSC_HOME", "."); System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); } diff --git a/aai-resources/src/test/java/org/openecomp/aai/schema/db/ManageSchemaTest.java b/aai-resources/src/test/java/org/openecomp/aai/schema/db/ManageSchemaTest.java index 9b7dd7c..9dade87 100644 --- a/aai-resources/src/test/java/org/openecomp/aai/schema/db/ManageSchemaTest.java +++ b/aai-resources/src/test/java/org/openecomp/aai/schema/db/ManageSchemaTest.java @@ -43,7 +43,7 @@ public class ManageSchemaTest { private TitanGraph graph = null; @BeforeClass public static void before() { - System.setProperty("AJSC_HOME", "./src/test/resources/");; + System.setProperty("AJSC_HOME", "."); System.setProperty("BUNDLECONFIG_DIR", "bundleconfig-local"); } diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/AAITxnLogTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/AAITxnLogTest.java new file mode 100644 index 0000000..57ba3eb --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/util/AAITxnLogTest.java @@ -0,0 +1,361 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.util; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.List; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.client.Get; +import org.apache.hadoop.hbase.client.HTable; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.util.Bytes; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.mockito.Mockito; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.agent.PowerMockAgent; +import org.powermock.modules.junit4.rule.PowerMockRule; + +import org.openecomp.aai.domain.notificationEvent.NotificationEvent; +import org.openecomp.aai.domain.translog.TransactionLogEntries; +import org.openecomp.aai.domain.translog.TransactionLogEntry; +import org.openecomp.aai.exceptions.AAIException; +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; + + +@Ignore +@PrepareForTest({HBaseConfiguration.class, Configuration.class, + HTable.class, Result.class, ResultScanner.class, Scan.class, + Get.class, NotificationEvent.class, + NotificationEvent.EventHeader.class, PojoUtils.class, AAITxnLog.class}) + +public class AAITxnLogTest { + + @Rule + public PowerMockRule rule = new PowerMockRule(); + + static { + PowerMockAgent.initializeIfNeeded(); + } + + AAITxnLog aaiTnxLog; + Configuration config; + HTable htable; + Result result; + ResultScanner resScanner; + Scan scan; + Get g; + NotificationEvent notif; + NotificationEvent.EventHeader ehNotif; + PojoUtils pu; + + boolean hasNotifEvent = true; + final String notifPayload = "A random payload"; + final String notifID = "1"; + final String notifEntityLink = "nLink"; + final String notifAction = "nAction"; + final String notifStatus = "nStatus"; + final String notifTopic = "nTopic"; + + final String tid = "tidVal"; + final String status = "statusVal"; + final String rqstTm = "rqstTmVal"; + final String respTm = "respTmVal"; + final String srcId = "srcIdVal"; + final String rsrcId = "rsrcIdVal"; + final String rsrcType = "rsrcTypeVal"; + final String rqstBuf = "rqstBufVal"; + final String respBuf = "respBufVal"; + + + /** + * Initialize. + */ + @Before + public void initialize(){ + partialSetupForAAIConfig(); + PowerMockito.mockStatic(HBaseConfiguration.class); + config = PowerMockito.mock(Configuration.class); + htable = PowerMockito.mock(HTable.class); + result = PowerMockito.mock(Result.class); + resScanner = PowerMockito.mock(ResultScanner.class); + scan = PowerMockito.mock(Scan.class); + g = PowerMockito.mock(Get.class); + notif = PowerMockito.mock(NotificationEvent.class); + ehNotif = PowerMockito.mock(NotificationEvent.EventHeader.class); + pu = PowerMockito.mock(PojoUtils.class); + + + mockNotificationEvent(); + + Mockito.when(HBaseConfiguration.create()).thenReturn(config); + aaiTnxLog = new AAITxnLog(tid, srcId); + + try { + PowerMockito.whenNew(HTable.class).withAnyArguments().thenReturn(htable); + PowerMockito.whenNew(Get.class).withAnyArguments().thenReturn(g); + PowerMockito.whenNew(PojoUtils.class).withAnyArguments().thenReturn(pu); + PowerMockito.whenNew(Scan.class).withAnyArguments().thenReturn(scan); + } catch (Exception e) { + e.printStackTrace(); + } + + mockResult(); + + try { + PowerMockito.when(htable.get(g)).thenReturn(result); + PowerMockito.when(htable.getScanner(scan)).thenReturn(resScanner); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * Method to test 'put' operation without a notification event. + */ + @Test + public void testPut_withoutNotifEvent(){ + String htid = aaiTnxLog.put(tid, status, rqstTm, respTm, srcId, rsrcId, rsrcType, rqstBuf, respBuf); + try { + TransactionLogEntry tle = aaiTnxLog.get(htid); + hasNotifEvent = false; + validateTransactionLogEntry(tle); + } catch (AAIException e) { + fail("Cant read back data from htable"); + e.printStackTrace(); + } + } + + /** + * Method to test 'put' operation with a notification event. + */ + @Test + public void testPut_withNotifEvent(){ + hasNotifEvent = true; + String htid = aaiTnxLog.put(tid, status, rqstTm, respTm, srcId, rsrcId, rsrcType, rqstBuf, respBuf, hasNotifEvent, notif); + try { + TransactionLogEntry tle = aaiTnxLog.get(htid); + validateTransactionLogEntry(tle); + } catch (AAIException e) { + fail("Cant read back data from htable"); + e.printStackTrace(); + } + } + + /** + * Method to test 'scan' over an empty htable. + */ + @Test + public void testScan_withEmptyHTable(){ + String key = tid; + List<String> res = aaiTnxLog.scan(key); + assertTrue("Scan output should be empty", res.size() == 0 ); + } + + /** + * Method to test 'scan' operation. + */ + @Test + public void testScan(){ + try { + PowerMockito.when(resScanner.next()).thenReturn(result).thenReturn(null); + } catch (IOException e) { + e.printStackTrace(); + } + List<String> res = aaiTnxLog.scan(tid); + assertTrue("Scan output should not be empty", res.size()==1); + assertTrue("Did not find entry in 'scan'", res.get(0).equals(result.toString())); + } + + /** + * Method to test 'scanFiltered' with an empty htable. + */ + @Test + public void testScanFiltered_withEmptyHTable(){ + aaiTnxLog.put(tid, status, rqstTm, respTm, srcId, rsrcId, rsrcType, rqstBuf, respBuf, true, new NotificationEvent()); + TransactionLogEntries tles = aaiTnxLog.scanFiltered(0, 100, null, null, null, null, null); + assertTrue ("scanFilstered output should be empty", tles.getTransactionLogEntries().size() == 0); + } + + /** + * Method to test 'scanFiltered' operation. + */ + @Test + public void testScanFiltered(){ + try { + PowerMockito.when(resScanner.next()).thenReturn(result).thenReturn(null); + } catch (IOException e) { + e.printStackTrace(); + } + aaiTnxLog.put(tid, status, rqstTm, respTm, srcId, rsrcId, rsrcType, rqstBuf, respBuf, true, new NotificationEvent()); + TransactionLogEntries tles = aaiTnxLog.scanFiltered(0, 100, null, null, null, null, null); + assertFalse ("scanFilstered output should not be empty", tles.getTransactionLogEntries().size() == 0); + validateTransactionLogEntry(tles.getTransactionLogEntries().get(0)); + } + + /** + * Helper method to validate the contents of a TransactionalLogEntry. + * + * @param tle TransactionalLogEntry to compare against + */ + public void validateTransactionLogEntry(TransactionLogEntry tle){ + String pre = "validateTransactionLogEntry: "; + String post = " didn't match"; + assertEquals(pre + "tid" + post, tle.getTransactionLogEntryId(), tid); + assertEquals(pre + "status" + post, tle.getStatus(), status); + assertEquals(pre + "rqstDate" + post, tle.getRqstDate(), rqstTm); + assertEquals(pre + "respDate" + post, tle.getRespDate(), respTm); + assertEquals(pre + "srcId" + post, tle.getSourceId(), srcId); + assertEquals(pre + "rsrcId" + post, tle.getResourceId(), rsrcId); + assertEquals(pre + "rqstBuf" + post, tle.getRqstBuf(), rqstBuf); + assertEquals(pre + "respBuf" + post, tle.getrespBuf(), respBuf); + if ( hasNotifEvent){ + assertEquals(pre + "notifPayload" + post, tle.getNotificationPayload(), notifPayload); + assertEquals(pre + "notifStatus" + post, tle.getNotificationStatus(), notifStatus); + assertEquals(pre + "notifID" + post, tle.getNotificationId(), notifID); + assertEquals(pre + "notifTopic" + post, tle.getNotificationTopic(), notifTopic); + assertEquals(pre + "notifEntityLink" + post, tle.getNotificationEntityLink(), notifEntityLink); + assertEquals(pre + "notifAction" + post, tle.getNotificationAction(), notifAction); + } + } + + + + /** + * Helper method to mock PojoUtils. + */ + public void mockPojoUtils(){ + + try { + PowerMockito.when(pu.getJsonFromObject(notif)).thenReturn(notifPayload); + } catch (JsonGenerationException e) {e.printStackTrace();} + catch (JsonMappingException e) {e.printStackTrace();} + catch (IOException e) {e.printStackTrace(); } + } + + + + /** + * Helper method to mock a notification event handler. + */ + public void mockNotifEventHandler(){ + PowerMockito.when(ehNotif.getId()).thenReturn(notifID); + PowerMockito.when(ehNotif.getEntityLink()).thenReturn(notifEntityLink); + PowerMockito.when(ehNotif.getAction()).thenReturn(notifAction); + PowerMockito.when(ehNotif.getStatus()).thenReturn(notifStatus); + } + + /** + * Helper method to mock a notification event. + */ + public void mockNotificationEvent(){ + mockPojoUtils(); + mockNotifEventHandler(); + PowerMockito.when(notif.getEventHeader()).thenReturn(ehNotif); + PowerMockito.when(notif.getEventHeader().getEventType()).thenReturn(null); + PowerMockito.when(notif.getEventHeader().getStatus()).thenReturn(null); + } + + + /** + * Helper method to build a mock-Result. + */ + public void mockResult(){ + PowerMockito.when(result.getValue(Bytes.toBytes("transaction"),Bytes.toBytes("tid"))).thenReturn(Bytes.toBytes(tid)); + PowerMockito.when(result.getValue(Bytes.toBytes("transaction"),Bytes.toBytes("status"))).thenReturn(Bytes.toBytes(status)); + PowerMockito.when(result.getValue(Bytes.toBytes("transaction"),Bytes.toBytes("rqstDate"))).thenReturn(Bytes.toBytes(rqstTm)); + PowerMockito.when(result.getValue(Bytes.toBytes("transaction"),Bytes.toBytes("respDate"))).thenReturn(Bytes.toBytes(respTm)); + PowerMockito.when(result.getValue(Bytes.toBytes("transaction"),Bytes.toBytes("sourceId"))).thenReturn(Bytes.toBytes(srcId)); + + PowerMockito.when(result.getValue(Bytes.toBytes("resource"),Bytes.toBytes("resourceId"))).thenReturn(Bytes.toBytes(rsrcId)); + PowerMockito.when(result.getValue(Bytes.toBytes("resource"),Bytes.toBytes("resourceType"))).thenReturn(Bytes.toBytes(rsrcType)); + + PowerMockito.when(result.getValue(Bytes.toBytes("payload"),Bytes.toBytes("rqstBuf"))).thenReturn(Bytes.toBytes(rqstBuf)); + PowerMockito.when(result.getValue(Bytes.toBytes("payload"),Bytes.toBytes("respBuf"))).thenReturn(Bytes.toBytes(respBuf)); + + PowerMockito.when(result.getValue(Bytes.toBytes("notification"),Bytes.toBytes("notificationPayload"))).thenReturn(Bytes.toBytes(notifPayload)); + PowerMockito.when(result.getValue(Bytes.toBytes("notification"),Bytes.toBytes("notificationStatus"))).thenReturn(Bytes.toBytes(notifStatus)); + PowerMockito.when(result.getValue(Bytes.toBytes("notification"),Bytes.toBytes("notificationId"))).thenReturn(Bytes.toBytes(notifID)); + PowerMockito.when(result.getValue(Bytes.toBytes("notification"),Bytes.toBytes("notificationTopic"))).thenReturn(Bytes.toBytes(notifTopic)); + PowerMockito.when(result.getValue(Bytes.toBytes("notification"),Bytes.toBytes("notificationEntityLink"))).thenReturn(Bytes.toBytes(notifEntityLink)); + PowerMockito.when(result.getValue(Bytes.toBytes("notification"),Bytes.toBytes("notificationAction"))).thenReturn(Bytes.toBytes(notifAction)); + } + + + /** + * Helper method to load aai config from test configuration file + * This requires that the 'test_aaiconfig.properties' file is available + */ + + static void setFinalStatic(Field field, Object newValue) throws Exception { + field.setAccessible(true); + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + field.set(null, newValue); + } + + /** + * Partial setup for AAI config. + */ + public void partialSetupForAAIConfig(){ + + try { + setFinalStatic(AAIConfig.class.getDeclaredField("GlobalPropFileName"), "src/test/resources/test_aaiconfig.properties"); + } + catch (SecurityException e) {fail();} + catch (NoSuchFieldException e) {fail();} + catch (Exception e) {fail();} + + AAIConfig.reloadConfig(); + } + + /** + * Helper method to set the file name of aaiconfig.properties file + * + * @param field Private static filed for update + * @param newValue New value to be used + * @throws Exception the exception + */ + public void modifyFinalStatic(Field field, Object newValue) throws Exception { + field.setAccessible(true); + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + field.set(null, newValue); + } + +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/DataConversionHelperTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/DataConversionHelperTest.java new file mode 100644 index 0000000..356010a --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/util/DataConversionHelperTest.java @@ -0,0 +1,88 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.util; + +import static org.junit.Assert.assertEquals; + +import org.junit.Rule; +import org.junit.Test; +import org.powermock.modules.agent.PowerMockAgent; +import org.powermock.modules.junit4.rule.PowerMockRule; + +public class DataConversionHelperTest { + + @Rule + public PowerMockRule rule = new PowerMockRule(); + + static { + PowerMockAgent.initializeIfNeeded(); + } + + /** + * Test convertIPVersionNumToString with value "4". + */ + @Test + public void testConvertIPVersionNumToString_withNum4(){ + assertEquals(DataConversionHelper.IPVERSION_IPV4, DataConversionHelper.convertIPVersionNumToString("4")); + } + + /** + * Test convertIPVersionNumToString with value "6". + */ + @Test + public void testConvertIPVersionNumToString_withNum6(){ + assertEquals(DataConversionHelper.IPVERSION_IPV6, DataConversionHelper.convertIPVersionNumToString("6")); + } + + /** + * Test convertIPVersionNumToString with a value other than "4" or "6". + */ + @Test + public void testConvertIPVersionNumToString_withAThirdNumber(){ + assertEquals(DataConversionHelper.IPVERSION_UNKNOWN, DataConversionHelper.convertIPVersionNumToString("-1")); + } + + /** + * Test convertIPVersionStringToNum with "v4". + */ + @Test + public void testConvertIPVersionStringToNum_withV4(){ + assertEquals("4", DataConversionHelper.convertIPVersionStringToNum(DataConversionHelper.IPVERSION_IPV4)); + } + + /** + * Test convertIPVersionStringToNum with "v6". + */ + @Test + public void testConvertIPVersionStringToNum_withV6(){ + assertEquals("6", DataConversionHelper.convertIPVersionStringToNum(DataConversionHelper.IPVERSION_IPV6)); + } + + /** + * Test convertIPVersionStringToNum with an illegal version. + */ + @Test + public void testConvertIPVersionStringToNum_withRandomString(){ + assertEquals("0", DataConversionHelper.convertIPVersionStringToNum("test string")); + } + + +} diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/DeleteResourceTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/DeleteResourceTest.java new file mode 100644 index 0000000..1522e80 --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/util/DeleteResourceTest.java @@ -0,0 +1,108 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.util; + + + +import static org.junit.Assert.assertEquals; + +import static org.junit.Assert.assertFalse; + +import static org.junit.Assert.assertTrue; + +import static org.junit.Assert.fail; + +import org.junit.Test; + + + +import org.openecomp.aai.domain.yang.PhysicalLink; + + + +public class DeleteResourceTest { + + + + /** + * Test getInstance. + */ + + @Test + + public void testGetInstance(){ + + Object obj = null; + + try { + + obj = DeleteResource.getInstance(DeleteResource.class); + + } catch (IllegalAccessException | InstantiationException e) { + + e.printStackTrace(); + + } + + assertTrue("Didn't get right instance", obj instanceof DeleteResource); + + } + + + + /** + * Test GetResourceVersion. + */ + + @Test + + public void testGetResourceVersion(){ + + String version = "aVersion"; + + PhysicalLink plink = new PhysicalLink(); + + plink.setResourceVersion(version); + + assertEquals("Versions didn't match", version, DeleteResource.GetResourceVersion(plink)); + + } + + + + /** + * Test null in GetResourceVersion. + */ + + @Test + + public void testGetResourceVersion_withNull(){ + + PhysicalLink plink = new PhysicalLink(); + + assertEquals("Versions didn't match", null, DeleteResource.GetResourceVersion(plink)); + + } + + + +} + diff --git a/aai-resources/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java b/aai-resources/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java new file mode 100644 index 0000000..e1fb24a --- /dev/null +++ b/aai-resources/src/test/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtilTest.java @@ -0,0 +1,71 @@ +/*- + * ============LICENSE_START======================================================= + * org.openecomp.aai + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.aai.util; + +import static org.junit.Assert.*; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.junit.Test; + + +public class JettyObfuscationConversionCommandLineUtilTest { + private final ByteArrayOutputStream testOut = new ByteArrayOutputStream(); + + /** + * Test. + */ + @Test + public void test() { + //setup, this will catch main's print statements for evaluation + System.setOut(new PrintStream(testOut)); + + /* ------ TEST OBFUSCATION ----*/ + JettyObfuscationConversionCommandLineUtil.main(new String[]{"-e", "hello world"}); + /* + * testOut was also catching any logging statements which interfered with result checking. + * This regex business was the workaround - it tries to find the expected value in + * the results and asserts against that. + */ + String obfResult = testOut.toString(); + String obfExpected = "OBF:1thf1ugo1x151wfw1ylz11tr1ymf1wg21x1h1uh21th7"; + Pattern obfExpectPat = Pattern.compile(obfExpected); + Matcher obfMatch = obfExpectPat.matcher(obfResult); + assertTrue(obfMatch.find()); + + testOut.reset(); //clear out previous result + + /* ------ TEST DEOBFUSCATION ----- */ + JettyObfuscationConversionCommandLineUtil.main(new String[]{"-d", obfExpected}); + String deobfResult = testOut.toString(); + String deobfExpected = "hello world"; + Pattern deobfExpectPat = Pattern.compile(deobfExpected); + Matcher deobfMatch = deobfExpectPat.matcher(deobfResult); + assertTrue(deobfMatch.find()); + + //clean up, resets to stdout + System.setOut(null); + } + +} diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties index 0558b26..3bd26bf 100644 --- a/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/aaiconfig.properties @@ -49,7 +49,7 @@ ecm.auth.password.x=OBF:1igd1i9a1jnb1yte1vv11vu91yt81jk71i6o1idt aai.avpn.interim.laginterface=ae0 aai.server.url.base=https://localhost:8443/aai/ -aai.server.url=https://localhost:8443/aai/v9/ +aai.server.url=https://localhost:8443/aai/v10/ aai.global.callback.url=https://localhost:8443/aai/ aai.auth.cspcookies_on=false @@ -94,22 +94,22 @@ aai.servicedescription.vusp=VIRTUAL USP aai.servicedescription.vvig=vVIGaaS aai.servicedescription.lrsi=LRSI-OSPF -aai.notification.current.version=v9 +aai.notification.current.version=v10 aai.notificationEvent.default.status=UNPROCESSED aai.notificationEvent.default.eventType=AAI-EVENT aai.notificationEvent.default.domain=devINT1 aai.notificationEvent.default.sourceName=aai aai.notificationEvent.default.sequenceNumber=0 aai.notificationEvent.default.severity=NORMAL -aai.notificationEvent.default.version=v9 +aai.notificationEvent.default.version=v10 # This one lets us enable/disable resource-version checking on updates/deletes aai.resourceversion.enableflag=true aai.logging.maxStackTraceEntries=10 -aai.default.api.version=v9 +aai.default.api.version=v10 # Used by Model-processing code aai.model.delete.sleep.per.vtx.msec=500 -aai.model.query.resultset.maxcount=30 +aai.model.query.resultset.maxcount=50 aai.model.query.timeout.sec=90 # Used by Data Grooming @@ -138,3 +138,5 @@ aai.dmaap.workload.enableEventProcessing=true aai.realtime.clients=RO,SDNC,MSO aai.server.rebind=g +aai.run.migrations=false +ecm.auth.password.x=OBF:1igd1i9a1jnb1yte1vv11vu91yt81jk71i6o1idt diff --git a/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/error.properties b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/error.properties index 4e98d62..11416ca 100644 --- a/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/error.properties +++ b/aai-resources/src/test/resources/bundleconfig-local/etc/appprops/error.properties @@ -110,6 +110,7 @@ AAI_6142=5:4:INFO:6142:400:3000:Retrying transaction AAI_6143=5:4:INFO:6143:400:3000:Ghost vertex found AAI_6144=5:4:WARN:6144:400:3000:Cycle found in graph AAI_6145=5:4:ERROR:6145:400:3000:Cannot create a nested/containment edge via relationship +AAI_6146=5:4:ERROR:6146:400:3000:Ambiguous identity map found, use a URI instead #--- aaicsvp: 7101-7199 AAI_7101=5:4:ERROR:7101:500:3002:Unexpected error in CSV file processing diff --git a/aai-resources/src/test/resources/com/att/aai/introspection/aai_oxm_v10.xml b/aai-resources/src/test/resources/com/att/aai/introspection/aai_oxm_v10.xml index cf53ad2..8479470 100644 --- a/aai-resources/src/test/resources/com/att/aai/introspection/aai_oxm_v10.xml +++ b/aai-resources/src/test/resources/com/att/aai/introspection/aai_oxm_v10.xml @@ -8,9 +8,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -1215,7 +1213,7 @@ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> </xml-properties> </xml-element> - <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v10.RelationshipList" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v10.RelationshipList" /> </java-attributes> <xml-properties> <xml-property name="description" value="Openstack snapshot" /> @@ -1598,6 +1596,7 @@ <xml-property name="description" value="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]" /> </xml-properties> </xml-element> + <xml-element container-type="java.util.ArrayList" java-attribute="testList" name="test-list" type="java.lang.String" /> <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v10.RelationshipList" /> <xml-element java-attribute="pInterfaces" name="p-interfaces" type="inventory.aai.openecomp.org.v10.PInterfaces" /> <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.openecomp.org.v10.LagInterfaces" /> @@ -5818,6 +5817,7 @@ value="the ASDC model id for this resource or service model." /> <xml-property name="visibility" value="deployment" /> <xml-property name="dbAlias" value="model-invariant-id-local" /> + <xml-property name="requires" value="model-version-id" /> </xml-properties> </xml-element> <xml-element java-attribute="modelVersionId" name="model-version-id" @@ -5827,6 +5827,7 @@ value="the ASDC model version for this resource or service model." /> <xml-property name="visibility" value="deployment" /> <xml-property name="dbAlias" value="model-version-id-local" /> + <xml-property name="requires" value="model-invariant-id" /> </xml-properties> </xml-element> <xml-element java-attribute="personaModelVer" name="persona-model-ver" diff --git a/aai-resources/src/test/resources/com/att/aai/introspection/aai_oxm_v9.xml b/aai-resources/src/test/resources/com/att/aai/introspection/aai_oxm_v9.xml index ee02d84..a0fc9c8 100644 --- a/aai-resources/src/test/resources/com/att/aai/introspection/aai_oxm_v9.xml +++ b/aai-resources/src/test/resources/com/att/aai/introspection/aai_oxm_v9.xml @@ -8,9 +8,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,61 +21,2234 @@ <xml-schema element-form-default="QUALIFIED"> <xml-ns namespace-uri="http://org.openecomp.aai.inventory/v9" /> </xml-schema> - <java-types> - <java-type name="Inventory"> + <java-types> + <java-type name="Inventory"> <xml-root-element name="inventory" /> <java-attributes> + <xml-element java-attribute="search" name="search" type="inventory.aai.openecomp.org.v9.Search" /> + <xml-element java-attribute="actions" name="actions" type="inventory.aai.openecomp.org.v9.Actions" /> + <xml-element java-attribute="cloudInfrastructure" name="cloud-infrastructure" type="inventory.aai.openecomp.org.v9.CloudInfrastructure" /> + <xml-element java-attribute="business" name="business" type="inventory.aai.openecomp.org.v9.Business" /> + <xml-element java-attribute="serviceDesignAndCreation" name="service-design-and-creation" type="inventory.aai.openecomp.org.v9.ServiceDesignAndCreation" /> <xml-element java-attribute="network" name="network" type="inventory.aai.openecomp.org.v9.Network" /> + <xml-element java-attribute="aaiInternal" name="aai-internal" type="inventory.aai.openecomp.org.v9.AaiInternal" /> + <xml-element java-attribute="nodes" name="nodes" type="inventory.aai.openecomp.org.v9.Nodes"/> </java-attributes> </java-type> - <java-type name="Network"> + + <java-type name="Nodes"> + <xml-root-element name="nodes" /> + </java-type> + <java-type name="Search"> + <xml-root-element name="search" /> + <java-attributes> + <xml-element java-attribute="edgeTagQueryResult" name="edge-tag-query-result" type="inventory.aai.openecomp.org.v9.EdgeTagQueryResult" /> + <xml-element java-attribute="edgeTagQueryRequest" name="edge-tag-query-request" type="inventory.aai.openecomp.org.v9.EdgeTagQueryRequest" /> + <xml-element java-attribute="searchResults" name="search-results" type="inventory.aai.openecomp.org.v9.SearchResults" /> + <xml-element java-attribute="sdnZoneResponse" name="sdn-zone-response" type="inventory.aai.openecomp.org.v9.SdnZoneResponse" /> + </java-attributes> + </java-type> + + <java-type name="EdgeTagQueryResult"> + <xml-root-element name="edge-tag-query-result" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="taggedInventoryItemList" name="tagged-inventory-item-list" type="inventory.aai.openecomp.org.v9.TaggedInventoryItemList" /> + </java-attributes> + </java-type> + + <java-type name="TaggedInventoryItemList"> + <xml-root-element name="tagged-inventory-item-list" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="inventoryItem" name="inventory-item" type="inventory.aai.openecomp.org.v9.InventoryItem" /> + </java-attributes> + </java-type> + + <java-type name="InventoryItem"> + <xml-root-element name="inventory-item" /> + <java-attributes> + <xml-element java-attribute="inventoryItemType" name="inventory-item-type" type="java.lang.String" /> + <xml-element java-attribute="inventoryItemLink" name="inventory-item-link" type="java.lang.String" /> + <xml-element container-type="java.util.ArrayList" java-attribute="inventoryItemData" name="inventory-item-data" type="inventory.aai.openecomp.org.v9.InventoryItemData" /> + <xml-element container-type="java.util.ArrayList" java-attribute="taggedInventoryItemList" name="tagged-inventory-item-list" type="inventory.aai.openecomp.org.v9.TaggedInventoryItemList" /> + </java-attributes> + </java-type> + + <java-type name="InventoryItemData"> + <xml-root-element name="inventory-item-data" /> + <java-attributes> + <xml-element java-attribute="propertyName" name="property-name" type="java.lang.String" /> + <xml-element java-attribute="propertyValue" name="property-value" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="EdgeTagQueryRequest"> + <xml-root-element name="edge-tag-query-request" /> + <java-attributes> + <xml-element java-attribute="edgeTag" name="edge-tag" type="java.lang.String" /> + <xml-element java-attribute="resultDetail" name="result-detail" type="java.lang.String" /> + <xml-element java-attribute="startNodeType" name="start-node-type" type="java.lang.String" /> + <xml-element container-type="java.util.ArrayList" java-attribute="startNodeFilter" name="start-node-filter" type="inventory.aai.openecomp.org.v9.StartNodeFilter" /> + <xml-element container-type="java.util.ArrayList" java-attribute="includeNodeFilter" name="include-node-filter" type="inventory.aai.openecomp.org.v9.IncludeNodeFilter" /> + <xml-element container-type="java.util.ArrayList" java-attribute="secondaryFilter" name="secondary-filter" type="inventory.aai.openecomp.org.v9.SecondaryFilter" /> + </java-attributes> + </java-type> + + <java-type name="StartNodeFilter"> + <xml-root-element name="start-node-filter" /> + <java-attributes> + <xml-element java-attribute="propertyName" name="property-name" type="java.lang.String" /> + <xml-element java-attribute="propertyValue" name="property-value" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="IncludeNodeFilter"> + <xml-root-element name="include-node-filter" /> + <java-attributes> + <xml-element java-attribute="includeNodeType" name="include-node-type" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="SecondaryFilter"> + <xml-root-element name="secondary-filter" /> + <java-attributes> + <xml-element java-attribute="propertyName" name="property-name" type="java.lang.String" /> + <xml-element java-attribute="filterType" name="filter-type" type="java.lang.String" /> + <xml-element java-attribute="propertyValue" name="property-value" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="SearchResults"> + <xml-root-element name="search-results" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="resultData" name="result-data" type="inventory.aai.openecomp.org.v9.ResultData" /> + </java-attributes> + </java-type> + + <java-type name="ResultData"> + <xml-root-element name="result-data" /> + <java-attributes> + <xml-element java-attribute="resourceType" name="resource-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The specific type of node in the A&AI graph" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceLink" name="resource-link" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The URL to the specific resource" /> + </xml-properties> + </xml-element> + </java-attributes> + </java-type> + + <java-type name="SdnZoneResponse"> + <xml-root-element name="sdn-zone-response" /> + <java-attributes> + <xml-element java-attribute="oamNetworks" name="oam-networks" type="inventory.aai.openecomp.org.v9.OamNetworks" /> + <xml-element container-type="java.util.ArrayList" java-attribute="azAndDvsSwitches" name="az-and-dvs-switches" type="inventory.aai.openecomp.org.v9.AzAndDvsSwitches" /> + </java-attributes> + </java-type> + + <java-type name="AzAndDvsSwitches"> + <xml-root-element name="az-and-dvs-switches" /> + <java-attributes> + <xml-element java-attribute="dvsSwitches" name="dvs-switches" type="inventory.aai.openecomp.org.v9.DvsSwitches" /> + <xml-element java-attribute="availabilityZone" name="availability-zone" type="inventory.aai.openecomp.org.v9.AvailabilityZone" /> + </java-attributes> + </java-type> + + <java-type name="Actions"> <xml-properties> - <xml-property name="description" value="Namespace for network inventory resources." /> + <xml-property name="description" value="APIs that are more action related than REST (e.g., notify, update)." /> </xml-properties> - <xml-root-element name="network" /> + <xml-root-element name="actions" /> <java-attributes> - <xml-element java-attribute="testObjects" name="test-objects" type="inventory.aai.openecomp.org.v9.TestObjects" /> - <xml-element java-attribute="vpnBindings" name="vpn-bindings" type="inventory.aai.openecomp.org.v9.VpnBindings" /> + <xml-element java-attribute="update" name="update" type="inventory.aai.openecomp.org.v9.Update" /> + <xml-element java-attribute="notify" name="notify" type="inventory.aai.openecomp.org.v9.Notify" /> + </java-attributes> + </java-type> + + <java-type name="Update"> + <xml-properties> + <xml-property name="description" value="Serves a PATCH like function. Does not enforce concurrency control. Clear each usage with AAI team." /> + </xml-properties> + <xml-root-element name="update" /> + <java-attributes> + <xml-element java-attribute="updateNodeType" name="update-node-type" required="true" type="java.lang.String" /> + <xml-element container-type="java.util.ArrayList" java-attribute="updateNodeKey" name="update-node-key" type="inventory.aai.openecomp.org.v9.UpdateNodeKey" /> + <xml-element java-attribute="updateNodeUri" name="update-node-uri" type="java.lang.String" /> + <xml-element container-type="java.util.ArrayList" java-attribute="action" name="action" type="inventory.aai.openecomp.org.v9.Action" /> + </java-attributes> + </java-type> + + <java-type name="Action"> + <xml-root-element name="action" /> + <java-attributes> + <xml-element java-attribute="actionType" name="action-type" type="java.lang.String" /> + <xml-element container-type="java.util.ArrayList" java-attribute="actionData" name="action-data" type="inventory.aai.openecomp.org.v9.ActionData" /> + </java-attributes> + </java-type> + + <java-type name="ActionData"> + <xml-root-element name="action-data" /> + <java-attributes> + <xml-element java-attribute="propertyName" name="property-name" type="java.lang.String" /> + <xml-element java-attribute="propertyValue" name="property-value" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="UpdateNodeKey"> + <xml-root-element name="update-node-key" /> + <java-attributes> + <xml-element java-attribute="keyName" name="key-name" type="java.lang.String" /> + <xml-element java-attribute="keyValue" name="key-value" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="Notify"> + <xml-root-element name="notify" /> + <java-attributes> + <xml-element java-attribute="eventId" name="event-id" required="true" type="java.lang.String" /> + <xml-element java-attribute="nodeType" name="node-type" type="java.lang.String" /> + <xml-element java-attribute="eventTrigger" name="event-trigger" type="java.lang.String" /> + <xml-element container-type="java.util.ArrayList" java-attribute="keyData" name="key-data" type="inventory.aai.openecomp.org.v9.KeyData" /> + <xml-element java-attribute="selflink" name="selflink" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="KeyData"> + <xml-root-element name="key-data" /> + <java-attributes> + <xml-element java-attribute="keyName" name="key-name" type="java.lang.String" /> + <xml-element java-attribute="keyValue" name="key-value" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="CloudInfrastructure"> + <xml-properties> + <xml-property name="description" value="Namespace for cloud infrastructure." /> + </xml-properties> + <xml-root-element name="cloud-infrastructure" /> + <java-attributes> + <xml-element java-attribute="complexes" name="complexes" type="inventory.aai.openecomp.org.v9.Complexes" /> + <xml-element java-attribute="cloudRegions" name="cloud-regions" type="inventory.aai.openecomp.org.v9.CloudRegions" /> + <xml-element java-attribute="networkProfiles" name="network-profiles" type="inventory.aai.openecomp.org.v9.NetworkProfiles" /> + <xml-element java-attribute="pservers" name="pservers" type="inventory.aai.openecomp.org.v9.Pservers" /> + <xml-element java-attribute="virtualDataCenters" name="virtual-data-centers" type="inventory.aai.openecomp.org.v9.VirtualDataCenters" /> + </java-attributes> + </java-type> + + <java-type name="CloudRegions"> + <xml-root-element name="cloud-regions" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="cloudRegion" name="cloud-region" type="inventory.aai.openecomp.org.v9.CloudRegion" /> + </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + </xml-properties> + </java-type> + + <java-type name="CloudRegion"> + <xml-root-element name="cloud-region" /> + <java-attributes> + <xml-element java-attribute="cloudOwner" name="cloud-owner" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Identifies the vendor and cloud name. First part of composite key should be formatted as vendor-cloudname" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="cloudRegionId" name="cloud-region-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Identifier used by the vendor for the region. Second part of composite key" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="cloudType" name="cloud-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Type of the cloud (e.g., openstack)" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ownerDefinedType" name="owner-defined-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Cloud-owner defined type indicator (e.g., dcp, lcp)" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="cloudRegionVersion" name="cloud-region-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Software version employed at the site. NOTE - THIS FIELD IS NOT KEPT UP TO DATE." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="identityUrl" name="identity-url" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL of the keystone identity service" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="cloudZone" name="cloud-zone" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Zone where the cloud is homed. NOTE - THIS FIELD IS NOT CORRECTLY POPULATED." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="complexName" name="complex-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="complex name for cloud-region instance. NOTE - THIS FIELD IS NOT CORRECTLY POPULATED." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="volumeGroups" name="volume-groups" type="inventory.aai.openecomp.org.v9.VolumeGroups" /> + <xml-element java-attribute="tenants" name="tenants" type="inventory.aai.openecomp.org.v9.Tenants" /> + <xml-element java-attribute="flavors" name="flavors" type="inventory.aai.openecomp.org.v9.Flavors" /> + <xml-element java-attribute="groupAssignments" name="group-assignments" type="inventory.aai.openecomp.org.v9.GroupAssignments" /> + <xml-element java-attribute="snapshots" name="snapshots" type="inventory.aai.openecomp.org.v9.Snapshots" /> + <xml-element java-attribute="images" name="images" type="inventory.aai.openecomp.org.v9.Images" /> + <xml-element java-attribute="dvsSwitches" name="dvs-switches" type="inventory.aai.openecomp.org.v9.DvsSwitches" /> + <xml-element java-attribute="oamNetworks" name="oam-networks" type="inventory.aai.openecomp.org.v9.OamNetworks" /> + <xml-element java-attribute="availabilityZones" name="availability-zones" type="inventory.aai.openecomp.org.v9.AvailabilityZones" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="cloud-region designates an installation of a cloud cluster or region or instantiation. In AT&Ts AIC cloud, this could be an LCP or DCP. Cloud regions are uniquely identified by a composite key, cloud-owner + cloud-region-id. The format of the cloud-owner is vendor-cloudname and we will use att-aic for AT&T's AIC." /> + <xml-property name="indexedProps" value="cloud-owner,cloud-region-id,cloud-type,owner-defined-type" /> + <xml-property name="nameProps" value="owner-defined-type" /> + <xml-property name="container" value="cloud-regions" /> + <xml-property name="namespace" value="cloud-infrastructure" /> + </xml-properties> + </java-type> + <java-type name="VolumeGroups"> + <xml-properties> + <xml-property name="description" value="Collection of persistent block-level storage." /> + </xml-properties> + <xml-root-element name="volume-groups" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="volumeGroup" name="volume-group" type="inventory.aai.openecomp.org.v9.VolumeGroup" /> + </java-attributes> + </java-type> + + <java-type name="VolumeGroup"> + <xml-root-element name="volume-group" /> + <java-attributes> + <xml-element java-attribute="volumeGroupId" name="volume-group-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID of volume-group." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="volumeGroupName" name="volume-group-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of the volume group." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Heat stack id corresponding to this volume-group" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this volume-group" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelCustomizationId" name="persona-model-customization-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="captures the id of all the configuration used to customize the resource for the service." /> + <xml-property name="dbAlias" value="model-customization-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfModulePersonaModelCustomizationId" name="vf-module-persona-model-customization-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="helps relate the volume group to the vf-module whose components will require the volume group" /> + <xml-property name="dbAlias" value="vf-module-model-customization-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Persistent block-level storage." /> + <xml-property name="indexedProps" value="volume-group-name,vnf-type,heat-stack-id,volume-group-id" /> + <xml-property name="searchable" value="volume-group-id,volume-group-name" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="volume-groups" /> + </xml-properties> + </java-type> + + <java-type name="RelationshipList"> + <xml-root-element name="relationship-list" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="relationship" name="relationship" type="inventory.aai.openecomp.org.v9.Relationship" /> + </java-attributes> + </java-type> + + <java-type name="Relationship"> + <xml-root-element name="relationship" /> + <java-attributes> + <xml-element java-attribute="relatedTo" name="related-to" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="A keyword provided by A&AI to indicate type of node." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relatedLink" name="related-link" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to the object in A&AI." /> + </xml-properties> + </xml-element> + <xml-element container-type="java.util.ArrayList" java-attribute="relationshipData" name="relationship-data" type="inventory.aai.openecomp.org.v9.RelationshipData" /> + <xml-element container-type="java.util.ArrayList" java-attribute="relatedToProperty" name="related-to-property" type="inventory.aai.openecomp.org.v9.RelatedToProperty" /> + </java-attributes> + </java-type> + + <java-type name="RelatedToProperty"> + <xml-root-element name="related-to-property" /> + <java-attributes> + <xml-element java-attribute="propertyKey" name="property-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Key part of a key/value pair" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="propertyValue" name="property-value" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Value part of a key/value pair" /> + </xml-properties> + </xml-element> + </java-attributes> + </java-type> + + <java-type name="RelationshipData"> + <xml-root-element name="relationship-data" /> + <java-attributes> + <xml-element java-attribute="relationshipKey" name="relationship-key" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="A keyword provided by A&AI to indicate an attribute." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipValue" name="relationship-value" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Value of the attribute." /> + </xml-properties> + </xml-element> + </java-attributes> + </java-type> + + <java-type name="Complexes"> + <xml-properties> + <xml-property name="description" value="Collection of physical locations that can house cloud-regions." /> + </xml-properties> + <xml-root-element name="complexes" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="complex" name="complex" type="inventory.aai.openecomp.org.v9.Complex" /> + </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + </xml-properties> + </java-type> + + <java-type name="Complex"> + <xml-root-element name="complex" /> + <java-attributes> + <xml-element java-attribute="physicalLocationId" name="physical-location-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique identifier for physical location, e.g., CLLI" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="dataCenterCode" name="data-center-code" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Data center code which can be an alternate way to identify a complex" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="complexName" name="complex-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Gamma complex name for LCP instance." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="identityUrl" name="identity-url" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL of the keystone identity service" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="physicalLocationType" name="physical-location-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Type, e.g., central office, data center." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="street1" name="street1" required="true" type="java.lang.String" /> + <xml-element java-attribute="street2" name="street2" type="java.lang.String" /> + <xml-element java-attribute="city" name="city" required="true" type="java.lang.String" /> + <xml-element java-attribute="state" name="state" type="java.lang.String" /> + <xml-element java-attribute="postalCode" name="postal-code" required="true" type="java.lang.String" /> + <xml-element java-attribute="country" name="country" required="true" type="java.lang.String" /> + <xml-element java-attribute="region" name="region" required="true" type="java.lang.String" /> + <xml-element java-attribute="latitude" name="latitude" type="java.lang.String" /> + <xml-element java-attribute="longitude" name="longitude" type="java.lang.String" /> + <xml-element java-attribute="elevation" name="elevation" type="java.lang.String" /> + <xml-element java-attribute="lata" name="lata" type="java.lang.String" /> + <xml-element java-attribute="ctagPools" name="ctag-pools" type="inventory.aai.openecomp.org.v9.CtagPools" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Collection of physical locations that can house cloud-regions." /> + <xml-property name="indexedProps" value="identity-url,data-center-code,complex-name,physical-location-id" /> + <xml-property name="searchable" value="physical-location-id,data-center-code,complex-name,street1,street2,postal-code" /> + <xml-property name="uniqueProps" value="physical-location-id" /> + <xml-property name="container" value="complexes" /> + <xml-property name="namespace" value="cloud-infrastructure" /> + </xml-properties> + </java-type> + + <java-type name="CtagPools"> + <xml-root-element name="ctag-pools" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="ctagPool" name="ctag-pool" type="inventory.aai.openecomp.org.v9.CtagPool" /> + </java-attributes> + </java-type> + + <java-type name="CtagPool"> + <xml-root-element name="ctag-pool" /> + <java-attributes> + <xml-element java-attribute="targetPe" name="target-pe" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="The Target provider edge router" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="availabilityZoneName" name="availability-zone-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Name of the availability zone" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ctagPoolPurpose" name="ctag-pool-purpose" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Describes what the intended purpose of this pool is." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ctagValues" name="ctag-values" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Comma separated list of ctags" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="A collection of C tags (vlan tags) grouped for a specific purpose." /> + <xml-property name="indexedProps" value="availability-zone-name" /> + <xml-property name="dependentOn" value="complex" /> + <xml-property name="container" value="ctag-pools" /> + </xml-properties> + </java-type> + + <java-type name="Tenants"> + <xml-properties> + <xml-property name="description" value="Collection of openstack tenants." /> + </xml-properties> + <xml-root-element name="tenants" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="tenant" name="tenant" type="inventory.aai.openecomp.org.v9.Tenant" /> + </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + </xml-properties> + </java-type> + + <java-type name="Tenant"> + <xml-root-element name="tenant" /> + <java-attributes> + <xml-element java-attribute="tenantId" name="tenant-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id relative to the cloud-region." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="tenantName" name="tenant-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Readable name of tenant" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vservers" name="vservers" type="inventory.aai.openecomp.org.v9.Vservers" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Openstack tenant" /> + <xml-property name="nameProps" value="tenant-name" /> + <xml-property name="indexedProps" value="tenant-name,tenant-id" /> + <xml-property name="searchable" value="tenant-id,tenant-name" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="tenants" /> + </xml-properties> + </java-type> + + <java-type name="Vservers"> + <xml-properties> + <xml-property name="description" value="Collection of virtual Servers, aka virtual machines or VMs." /> + </xml-properties> + <xml-root-element name="vservers" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="vserver" name="vserver" type="inventory.aai.openecomp.org.v9.Vserver" /> + </java-attributes> + </java-type> + + <java-type name="Vserver"> + <xml-root-element name="vserver" /> + <java-attributes> + <xml-element java-attribute="vserverId" name="vserver-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique identifier for this vserver relative to its tenant" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vserverName" name="vserver-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of vserver" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vserverName2" name="vserver-name2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Alternative name of vserver" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vserverSelflink" name="vserver-selflink" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="Used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs." /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="isClosedLoopDisabled" name="is-closed-loop-disabled" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="Used to indicate whether closed loop function is enabled on this node" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="volumes" name="volumes" type="inventory.aai.openecomp.org.v9.Volumes" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.openecomp.org.v9.LInterfaces" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Virtual Servers, aka virtual machine or VM." /> + <xml-property name="nameProps" value="vserver-name" /> + <xml-property name="indexedProps" value="is-closed-loop-disabled,prov-status,vserver-name,vserver-id,in-maint,vserver-name2" /> + <xml-property name="searchable" value="vserver-id,vserver-name,vserver-name2" /> + <xml-property name="dependentOn" value="tenant" /> + <xml-property name="container" value="vservers" /> + </xml-properties> + </java-type> + + <java-type name="LInterfaces"> + <xml-properties> + <xml-property name="description" value="Collection of logical interfaces." /> + </xml-properties> + <xml-root-element name="l-interfaces" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="lInterface" name="l-interface" type="inventory.aai.openecomp.org.v9.LInterface" /> + </java-attributes> + </java-type> + + <java-type name="LInterface"> + <xml-root-element name="l-interface" /> + <java-attributes> + <xml-element java-attribute="interfaceName" name="interface-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Name given to the interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="E.g., CUSTOMER, UPLINK, etc." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="v6WanLinkIp" name="v6-wan-link-ip" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Questionably placed - v6 ip addr of this interface (is in vr-lan-interface from Mary B." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="selflink" name="selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceId" name="interface-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="ID of interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="macaddr" name="macaddr" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="MAC address for the interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkName" name="network-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of the network" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Whether A&AI should be managing this interface of not. Could have value like CUSTOMER" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceDescription" name="interface-description" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Human friendly text regarding this interface." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlans" name="vlans" type="inventory.aai.openecomp.org.v9.Vlans" /> + <xml-element java-attribute="sriovVfs" name="sriov-vfs" type="inventory.aai.openecomp.org.v9.SriovVfs" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv4AddressList" name="l3-interface-ipv4-address-list" type="inventory.aai.openecomp.org.v9.L3InterfaceIpv4AddressList" /> + <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv6AddressList" name="l3-interface-ipv6-address-list" type="inventory.aai.openecomp.org.v9.L3InterfaceIpv6AddressList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Logical interfaces, e.g., a vnic." /> + <xml-property name="indexedProps" value="macaddr,interface-id,interface-name,network-name" /> + <xml-property name="dependentOn" value="generic-vnf,newvce,vpe,p-interface,vserver,lag-interface" /> + <xml-property name="container" value="l-interfaces" /> + </xml-properties> + </java-type> + + <java-type name="SriovVfs"> + <xml-properties> + <xml-property name="description" value="Collection of SR-IOV Virtual Functions." /> + </xml-properties> + <xml-root-element name="sriov-vfs" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="sriovVf" name="sriov-vf" type="inventory.aai.openecomp.org.v9.SriovVf" /> + </java-attributes> + </java-type> + <java-type name="SriovVf"> + <xml-root-element name="sriov-vf" /> + <java-attributes> + <xml-element java-attribute="pciId" name="pci-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="PCI ID used to identify the sriov-vf" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfVlanFilter" name="vf-vlan-filter" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="This metadata provides option to specify list of VLAN filters applied on VF to pass the traffic to VM." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfMacFilter" name="vf-mac-filter" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="When MAC filters are specified, VF-agent service configures VFs to do MAC level filtering before the traffic is passed to VM." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfVlanStrip" name="vf-vlan-strip" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="When this field is set to true, VF will configured to strip the outer TAG before the traffic is passed to VM." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfVlanAntiSpoofCheck" name="vf-vlan-anti-spoof-check" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="This option ensures anti VLAN spoof checks are done at the VF level to comply with security. The disable check will also be honored per the VNF needs for trusted VMs." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfMacAntiSpoofCheck" name="vf-mac-anti-spoof-check" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="This option ensures anti MAC spoof checks are done at the VF level to comply with security. The disable check will also be honored per the VNF needs for trusted VMs." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfMirrors" name="vf-mirrors" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="This option defines the set of Mirror objects which essentially mirrors the traffic from source to set of collector VNF Ports." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfBroadcastAllow" name="vf-broadcast-allow" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="This option, if set to true, sets the VF in promiscuous mode and allows all broadcast traffic to reach the VM" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfUnknownMulticastAllow" name="vf-unknown-multicast-allow" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="This option, if set to true, sets the VF in promiscuous mode and allows unknown multicast traffic to reach the VM" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfUnknownUnicastAllow" name="vf-unknown-unicast-allow" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="This option, if set to true, sets the VF in promiscuous mode and allows unknown unicast traffic to reach the VM" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfInsertStag" name="vf-insert-stag" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="This option, if set to true, instructs to insert outer tag after traffic comes out of VM." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vfLinkStatus" name="vf-link-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="This option is used to set the link status. Valid values as of 1607 are on, off, and auto." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron network id of the interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="SR-IOV Virtual Function (not to be confused with virtual network function)" /> + <xml-property name="indexedProps" value="pci-id,vf-vlan-filter,vf-mac-filter,vf-vlan-strip,neutron-network-id" /> + <xml-property name="dependentOn" value="l-interface" /> + <xml-property name="container" value="sriov-vfs" /> + </xml-properties> + </java-type> + + <java-type name="L3InterfaceIpv4AddressList"> + <xml-root-element name="l3-interface-ipv4-address-list" /> + <java-attributes> + <xml-element java-attribute="l3InterfaceIpv4Address" name="l3-interface-ipv4-address" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="IP address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="l3InterfaceIpv4PrefixLength" name="l3-interface-ipv4-prefix-length" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Prefix length, 32 for single address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanIdInner" name="vlan-id-inner" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Inner VLAN tag" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Outer VLAN tag" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="isFloating" name="is-floating" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="Indicator of fixed or floating address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron network id of the interface that address belongs to" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronSubnetId" name="neutron-subnet-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron id of subnet that address belongs to" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="IPv4 Address Range" /> + <xml-property name="indexedProps" value="l3-interface-ipv4-address,vlan-id-inner,neutron-network-id,neutron-subnet-id" /> + <xml-property name="dependentOn" value="vlan,l-interface" /> + </xml-properties> + </java-type> + + <java-type name="Vlans"> + <xml-root-element name="vlans" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="vlan" name="vlan" type="inventory.aai.openecomp.org.v9.Vlan" /> + </java-attributes> + </java-type> + + <java-type name="Vlan"> + <xml-root-element name="vlan" /> + <java-attributes> + <xml-element java-attribute="vlanInterface" name="vlan-interface" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="String that identifies the interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanIdInner" name="vlan-id-inner" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Inner VLAN tag" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Outer VLAN tag" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Captures the numeric part of the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Captures the units corresponding to the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanDescription" name="vlan-description" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used to describe (the service associated with) the vlan" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="backdoorConnection" name="backdoor-connection" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Whether customer is going to use this VLAN for backdoor connection to another customer premise device." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vpnId" name="vpn-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="This indicates the customers VPN ID associated with this vlan" /> + <xml-property name="dbAlias" value="vpn-id-local" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Status of a vnf's vlan interface, on which the customer circuit resides, mastered by SDN-C." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv4AddressList" name="l3-interface-ipv4-address-list" type="inventory.aai.openecomp.org.v9.L3InterfaceIpv4AddressList" /> + <xml-element container-type="java.util.ArrayList" java-attribute="l3InterfaceIpv6AddressList" name="l3-interface-ipv6-address-list" type="inventory.aai.openecomp.org.v9.L3InterfaceIpv6AddressList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Definition of vlan" /> + <xml-property name="indexedProps" value="vlan-interface,vlan-id-inner,vpn-id" /> + <xml-property name="uniqueProps" value="vpn-id" /> + <xml-property name="dependentOn" value="l-interface" /> + <xml-property name="container" value="vlans" /> + </xml-properties> + </java-type> + + <java-type name="L3InterfaceIpv6AddressList"> + <xml-root-element name="l3-interface-ipv6-address-list" /> + <java-attributes> + <xml-element java-attribute="l3InterfaceIpv6Address" name="l3-interface-ipv6-address" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="IP address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="l3InterfaceIpv6PrefixLength" name="l3-interface-ipv6-prefix-length" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Prefix length, 128 for single address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanIdInner" name="vlan-id-inner" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Inner VLAN tag" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Outer VLAN tag" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="isFloating" name="is-floating" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="Indicator of fixed or floating address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron network id of the interface that address belongs to" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronSubnetId" name="neutron-subnet-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron id of subnet that address belongs to" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="IPv6 Address Range" /> + <xml-property name="indexedProps" value="l3-interface-ipv6-address,vlan-id-inner,neutron-network-id,neutron-subnet-id" /> + <xml-property name="dependentOn" value="vlan,l-interface" /> + </xml-properties> + </java-type> + + <java-type name="Volumes"> + <xml-properties> + <xml-property name="description" value="Collection of ephemeral Block storage volumes." /> + </xml-properties> + <xml-root-element name="volumes" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="volume" name="volume" type="inventory.aai.openecomp.org.v9.Volume" /> + </java-attributes> + </java-type> + + <java-type name="Volume"> + <xml-root-element name="volume" /> + <java-attributes> + <xml-element java-attribute="volumeId" name="volume-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID of block storage volume relative to the vserver." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="volumeSelflink" name="volume-selflink" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Ephemeral Block storage volume." /> + <xml-property name="indexedProps" value="volume-id" /> + <xml-property name="dependentOn" value="vserver" /> + <xml-property name="container" value="volumes" /> + </xml-properties> + </java-type> + + <java-type name="Flavors"> + <xml-properties> + <xml-property name="description" value="Collection of openstack flavors." /> + </xml-properties> + <xml-root-element name="flavors" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="flavor" name="flavor" type="inventory.aai.openecomp.org.v9.Flavor" /> + </java-attributes> + </java-type> + + <java-type name="Flavor"> + <xml-root-element name="flavor" /> + <java-attributes> + <xml-element java-attribute="flavorId" name="flavor-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Flavor id, expected to be unique across cloud-region." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorName" name="flavor-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Flavor name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorVcpus" name="flavor-vcpus" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="Number of CPUs" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorRam" name="flavor-ram" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="Amount of memory" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorDisk" name="flavor-disk" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="Disk space" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorEphemeral" name="flavor-ephemeral" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="Amount of ephemeral disk space" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorSwap" name="flavor-swap" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="amount of swap space allocation" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorIsPublic" name="flavor-is-public" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="whether flavor is available to all users or private to the tenant it was created in." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorSelflink" name="flavor-selflink" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="flavorDisabled" name="flavor-disabled" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="Boolean as to whether this flavor is no longer enabled" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Openstack flavor." /> + <xml-property name="nameProps" value="flavor-name" /> + <xml-property name="indexedProps" value="flavor-name,flavor-id" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="flavors" /> + </xml-properties> + </java-type> + + <java-type name="Snapshots"> + <xml-properties> + <xml-property name="description" value="Collection of openstack snapshots" /> + </xml-properties> + <xml-root-element name="snapshots" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="snapshot" name="snapshot" type="inventory.aai.openecomp.org.v9.Snapshot" /> + </java-attributes> + </java-type> + + <java-type name="Snapshot"> + <xml-root-element name="snapshot" /> + <java-attributes> + <xml-element java-attribute="snapshotId" name="snapshot-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Snapshot id, this is the key UUID assoc associated in glance with the snapshots." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="snapshotName" name="snapshot-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Snapshot name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="snapshotArchitecture" name="snapshot-architecture" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Operating system architecture" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="snapshotOsDistro" name="snapshot-os-distro" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The common name of the operating system distribution in lowercase" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="snapshotOsVersion" name="snapshot-os-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The operating system version as specified by the distributor." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="application" name="application" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The application that the image instantiates." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="applicationVendor" name="application-vendor" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The vendor of the application." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="applicationVersion" name="application-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The version of the application." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="snapshotSelflink" name="snapshot-selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="prevSnapshotId" name="prev-snapshot-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="This field contains the UUID of the previous snapshot (if any)." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Openstack snapshot" /> + <xml-property name="nameProps" value="snapshot-name" /> + <xml-property name="uniqueProps" value="snapshot-id" /> + <xml-property name="indexedProps" value="application,snapshot-name,application-vendor,snapshot-id,application-version,prev-snapshot-id" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="snapshots" /> + </xml-properties> + </java-type> + + <java-type name="GroupAssignments"> + <xml-properties> + <xml-property name="description" value="Collection of openstack group assignments" /> + </xml-properties> + <xml-root-element name="group-assignments" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="groupAssignment" name="group-assignment" type="inventory.aai.openecomp.org.v9.GroupAssignment" /> + </java-attributes> + </java-type> + + <java-type name="GroupAssignment"> + <xml-root-element name="group-assignment" /> + <java-attributes> + <xml-element java-attribute="groupId" name="group-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Group id, expected to be unique across cloud-region." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="groupType" name="group-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Group type - the type of group this instance refers to" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="groupName" name="group-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Group name - name assigned to the group" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="groupDescription" name="group-description" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Group description - description of the group" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Openstack group-assignment used to store exclusivity groups (EG)." /> + <xml-property name="nameProps" value="group-name" /> + <xml-property name="indexedProps" value="group-id,group-type,group-name" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="group-assignments" /> + </xml-properties> + </java-type> + + <java-type name="Images"> + <xml-properties> + <xml-property name="description" value="Collectio of Openstack images." /> + </xml-properties> + <xml-root-element name="images" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="image" name="image" type="inventory.aai.openecomp.org.v9.Image" /> + </java-attributes> + </java-type> + + <java-type name="Image"> + <xml-root-element name="image" /> + <java-attributes> + <xml-element java-attribute="imageId" name="image-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Image id, expected to be unique across cloud region" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="imageName" name="image-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Image name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="imageArchitecture" name="image-architecture" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Operating system architecture." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="imageOsDistro" name="image-os-distro" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The common name of the operating system distribution in lowercase" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="imageOsVersion" name="image-os-version" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The operating system version as specified by the distributor." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="application" name="application" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The application that the image instantiates." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="applicationVendor" name="application-vendor" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The vendor of the application." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="applicationVersion" name="application-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The version of the application." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="imageSelflink" name="image-selflink" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="metadata" name="metadata" type="inventory.aai.openecomp.org.v9.Metadata" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Openstack image." /> + <xml-property name="nameProps" value="image-name" /> + <xml-property name="indexedProps" value="application,image-name,application-vendor,image-id,application-version" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="images" /> + </xml-properties> + </java-type> + + <java-type name="Metadata"> + <xml-properties> + <xml-property name="description" value="Collection of metadatum (key/value pairs)" /> + </xml-properties> + <xml-root-element name="metadata" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="metadatum" name="metadatum" type="inventory.aai.openecomp.org.v9.Metadatum" /> + </java-attributes> + </java-type> + + <java-type name="Metadatum"> + <xml-root-element name="metadatum" /> + <java-attributes> + <xml-element java-attribute="metaname" name="metaname" required="true" type="java.lang.String" xml-key="true" /> + <xml-element java-attribute="metaval" name="metaval" required="true" type="java.lang.String" /> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Key/value pairs" /> + <xml-property name="indexedProps" value="metaname" /> + <xml-property name="dependentOn" value="tenant,image,service-instance,connector,model" /> + <xml-property name="container" value="metadata" /> + </xml-properties> + </java-type> + + <java-type name="DvsSwitches"> + <xml-properties> + <xml-property name="description" value="Collection of digital virtual switch metadata used for vmWare VCEs and VPEs." /> + </xml-properties> + <xml-root-element name="dvs-switches" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="dvsSwitch" name="dvs-switch" type="inventory.aai.openecomp.org.v9.DvsSwitch" /> + </java-attributes> + </java-type> + + <java-type name="DvsSwitch"> + <xml-root-element name="dvs-switch" /> + <java-attributes> + <xml-element java-attribute="switchName" name="switch-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="DVS switch name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vcenterUrl" name="vcenter-url" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL used to reach the vcenter" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Digital virtual switch metadata, used by SDN-C to configure VCEs. A&AI needs to receive this data from the PO deployment team and administer it using the provisioningTool.sh into A&AI. " /> + <xml-property name="indexedProps" value="vcenter-url,switch-name" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="dvs-switches" /> + </xml-properties> + </java-type> + + <java-type name="NetworkProfiles"> + <xml-properties> + <xml-property name="description" value="Collection of network profiles" /> + </xml-properties> + <xml-root-element name="network-profiles" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="networkProfile" name="network-profile" type="inventory.aai.openecomp.org.v9.NetworkProfile" /> + </java-attributes> + </java-type> + + <java-type name="NetworkProfile"> + <xml-root-element name="network-profile" /> + <java-attributes> + <xml-element java-attribute="nmProfileName" name="nm-profile-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique name of network profile." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="communityString" name="community-string" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Encrypted SNMP community string" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Network profile populated by SDN-GP for SNMP" /> + <xml-property name="indexedProps" value="nm-profile-name" /> + <xml-property name="container" value="network-profiles" /> + <xml-property name="namespace" value="cloud-infrastructure" /> + </xml-properties> + </java-type> + + <java-type name="Pservers"> + <xml-properties> + <xml-property name="description" value="Collection of compute hosts." /> + </xml-properties> + <xml-root-element name="pservers" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="pserver" name="pserver" type="inventory.aai.openecomp.org.v9.Pserver" /> + </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + </xml-properties> + </java-type> + + <java-type name="Pserver"> + <xml-root-element name="pserver" /> + <java-attributes> + <xml-element java-attribute="hostname" name="hostname" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Value from executing hostname on the compute node." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ptniiEquipName" name="ptnii-equip-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="PTNII name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="numberOfCpus" name="number-of-cpus" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="Number of cpus" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="diskInGigabytes" name="disk-in-gigabytes" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="Disk size, in GBs" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ramInMegabytes" name="ram-in-megabytes" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="RAM size, in MBs" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipType" name="equip-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Equipment type. Source of truth should define valid values." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipVendor" name="equip-vendor" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Equipment vendor. Source of truth should define valid values." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipModel" name="equip-model" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Equipment model. Source of truth should define valid values." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="fqdn" name="fqdn" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Fully-qualified domain name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="pserverSelflink" name="pserver-selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used to configure device, also used for troubleshooting and is IP used for traps generated by device." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serialNumber" name="serial-number" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Serial number, may be queried" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV4Loopback0" name="ipaddress-v4-loopback-0" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV4 Loopback 0 address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV6Loopback0" name="ipaddress-v6-loopback-0" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV6 Loopback 0 address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV4Aim" name="ipaddress-v4-aim" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV4 AIM address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV6Aim" name="ipaddress-v6-aim" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV6 AIM address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV6Oam" name="ipaddress-v6-oam" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV6 OAM address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="invStatus" name="inv-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="CANOPI's inventory status. Only set with values exactly as defined by CANOPI." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="pserverId" name="pserver-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="ID of Pserver" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="internetTopology" name="internet-topology" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="internet topology of Pserver" /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="pserverName2" name="pserver-name2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="alternative pserver name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="purpose" name="purpose" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="purpose of pserver" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="pInterfaces" name="p-interfaces" type="inventory.aai.openecomp.org.v9.PInterfaces" /> + <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.openecomp.org.v9.LagInterfaces" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Compute host whose hostname must be unique and must exactly match what is sent as a relationship to a vserver." /> + <xml-property name="nameProps" value="pserver-name2" /> + <xml-property name="indexedProps" value="hostname,in-maint,pserver-id,pserver-name2,inv-status" /> + <xml-property name="searchable" value="hostname,pserver-name2,pserver-id,ipv4-oam-address" /> + <xml-property name="container" value="pservers" /> + <xml-property name="namespace" value="cloud-infrastructure" /> + </xml-properties> + </java-type> + + <java-type name="PInterfaces"> + <xml-properties> + <xml-property name="description" value="Collection of physical interfaces." /> + </xml-properties> + <xml-root-element name="p-interfaces" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="pInterface" name="p-interface" type="inventory.aai.openecomp.org.v9.PInterface" /> + </java-attributes> + </java-type> + + <java-type name="PInterface"> + <xml-root-element name="p-interface" /> + <java-attributes> + <xml-element java-attribute="interfaceName" name="interface-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Name that identifies the physical interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Captures the numeric part of the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Captures the units corresponding to the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="portDescription" name="port-description" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Nature of the services and connectivity on this port." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipmentIdentifier" name="equipment-identifier" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="CLEI or other specification for p-interface hardware." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Role specification for p-interface hardware." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceType" name="interface-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indicates the physical properties of the interface." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.openecomp.org.v9.LInterfaces" /> </java-attributes> + <xml-properties> + <xml-property name="description" value="Physical interface (e.g., nic)" /> + <xml-property name="indexedProps" value="interface-name,prov-status" /> + <xml-property name="nameProps" value="prov-status" /> + <xml-property name="dependentOn" value="vpls-pe,pserver,pnf" /> + <xml-property name="container" value="p-interfaces" /> + </xml-properties> </java-type> + + <java-type name="LagInterfaces"> + <xml-properties> + <xml-property name="description" value="Collection of link aggregate interfaces." /> + </xml-properties> + <xml-root-element name="lag-interfaces" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="lagInterface" name="lag-interface" type="inventory.aai.openecomp.org.v9.LagInterface" /> + </java-attributes> + </java-type> + + <java-type name="LagInterface"> + <xml-root-element name="lag-interface" /> + <java-attributes> + <xml-element java-attribute="interfaceName" name="interface-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Name that identifies the link aggregate interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceDescription" name="interface-description" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Human friendly text regarding this interface." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Captures the numeric part of the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Captures the units corresponding to the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceId" name="interface-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="ID of interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Role assigned to this Interface, should use values as defined in ECOMP Yang models." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.openecomp.org.v9.LInterfaces" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Link aggregate interface" /> + <xml-property name="indexedProps" value="interface-name,interface-id,interface-role" /> + <xml-property name="dependentOn" value="generic-vnf,pserver,vpe,vpls-pe,pnf" /> + <xml-property name="container" value="lag-interfaces" /> + </xml-properties> + </java-type> + + <java-type name="OamNetworks"> + <xml-properties> + <xml-property name="description" value="Collection of OAM networks, to be deprecated shortly. Do not use for new purposes. " /> + </xml-properties> + <xml-root-element name="oam-networks" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="oamNetwork" name="oam-network" type="inventory.aai.openecomp.org.v9.OamNetwork" /> + </java-attributes> + </java-type> + + <java-type name="OamNetwork"> + <xml-root-element name="oam-network" /> + <java-attributes> + <xml-element java-attribute="networkUuid" name="network-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="UUID of the network. Unique across a cloud-region" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkName" name="network-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of the network." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="cvlanTag" name="cvlan-tag" required="true" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="cvlan-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamGatewayAddress" name="ipv4-oam-gateway-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for VNF firewall rule so customer cannot send customer traffic over this oam network" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamGatewayAddressPrefixLength" name="ipv4-oam-gateway-address-prefix-length" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="Used for VNF firewall rule so customer cannot send customer traffic over this oam network" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="OAM network, to be deprecated shortly. Do not use for new purposes. " /> + <xml-property name="nameProps" value="network-name" /> + <xml-property name="indexedProps" value="cvlan-tag,network-uuid,network-name" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="oam-networks" /> + </xml-properties> + </java-type> + + <java-type name="AvailabilityZones"> + <xml-properties> + <xml-property name="description" value="Collection of availability zones" /> + </xml-properties> + <xml-root-element name="availability-zones" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="availabilityZone" name="availability-zone" type="inventory.aai.openecomp.org.v9.AvailabilityZone" /> + </java-attributes> + </java-type> + + <java-type name="AvailabilityZone"> + <xml-root-element name="availability-zone" /> + <java-attributes> + <xml-element java-attribute="availabilityZoneName" name="availability-zone-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Name of the availability zone. Unique across a cloud region" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="hypervisorType" name="hypervisor-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Type of hypervisor. Source of truth should define valid values." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="operationalState" name="operational-state" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="State that indicates whether the availability zone should be used, etc. Source of truth should define valid values." /> + <xml-property name="dbAlias" value="operational-status" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Availability zone, a collection of compute hosts/pservers" /> + <xml-property name="indexedProps" value="availability-zone-name" /> + <xml-property name="dependentOn" value="cloud-region" /> + <xml-property name="container" value="availability-zones" /> + </xml-properties> + </java-type> + + <java-type name="VirtualDataCenters"> + <xml-properties> + <xml-property name="description" value="Virtual organization of cloud infrastructure elements in a data center context" /> + </xml-properties> + <xml-root-element name="virtual-data-centers" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="virtualDataCenter" name="virtual-data-center" type="inventory.aai.openecomp.org.v9.VirtualDataCenter" /> + </java-attributes> + </java-type> + + <java-type name="VirtualDataCenter"> + <xml-root-element name="virtual-data-center" /> + <java-attributes> + <xml-element java-attribute="vdcId" name="vdc-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID of the vdc" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vdcName" name="vdc-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of the virtual data center" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Virtual organization of cloud infrastructure elements in a data center context" /> + <xml-property name="nameProps" value="vdc-name" /> + <xml-property name="indexedProps" value="vdc-name,vdc-id" /> + <xml-property name="container" value="virtual-data-centers" /> + <xml-property name="namespace" value="cloud-infrastructure" /> + </xml-properties> + </java-type> + + + + + <java-type name="Business"> + <xml-properties> + <xml-property name="description" value="Namespace for business related constructs" /> + </xml-properties> + <xml-root-element name="business" /> + <java-attributes> + <xml-element java-attribute="connectors" name="connectors" type="inventory.aai.openecomp.org.v9.Connectors" /> + <xml-element java-attribute="customers" name="customers" type="inventory.aai.openecomp.org.v9.Customers" /> + </java-attributes> + </java-type> + + <java-type name="Connectors"> + <xml-properties> + <xml-property name="description" value="Collection of resource instances used to connect a variety of disparate inventory widgets" /> + </xml-properties> + <xml-root-element name="connectors" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="connector" name="connector" type="inventory.aai.openecomp.org.v9.Connector" /> + </java-attributes> + </java-type> + + <java-type name="Connector"> + <xml-root-element name="connector" /> + <java-attributes> + <xml-element java-attribute="resourceInstanceId" name="resource-instance-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of resource instance." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelId" name="persona-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model id for this resource or service model." /> + <xml-property name="dbAlias" value="model-invariant-id-local" /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="internal" /> + <xml-property name="dbAlias" value="model-version-id-local" /> + <xml-property name="dataCopy" value="service-design-and-creation/models/model/{persona-model-id}/model-vers?model-version={persona-model-version}#model-version-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&AI widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="metadata" name="metadata" type="inventory.aai.openecomp.org.v9.Metadata" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Collection of resource instances used to connect a variety of disparate inventory widgets" /> + <xml-property name="indexedProps" value="resource-instance-id,persona-model-id,persona-model-version,widget-model-id,widget-model-version" /> + <xml-property name="container" value="connectors" /> + <xml-property name="namespace" value="business" /> + </xml-properties> + </java-type> + + <java-type name="Customers"> + <xml-properties> + <xml-property name="description" value="Collection of customer identifiers to provide linkage back to BSS information." /> + </xml-properties> + <xml-root-element name="customers" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="customer" name="customer" type="inventory.aai.openecomp.org.v9.Customer" /> + </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + </xml-properties> + </java-type> + + <java-type name="Customer"> + <xml-root-element name="customer" /> + <java-attributes> + <xml-element java-attribute="globalCustomerId" name="global-customer-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Global customer id used across ECOMP to uniquely identify customer." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="subscriberName" name="subscriber-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Subscriber name, an alternate way to retrieve a customer." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="subscriberType" name="subscriber-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Subscriber type, a way to provide VID with only the INFRA customers." /> + <xml-property name="defaultValue" value="CUST" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceSubscriptions" name="service-subscriptions" type="inventory.aai.openecomp.org.v9.ServiceSubscriptions" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="customer identifiers to provide linkage back to BSS information." /> + <xml-property name="nameProps" value="subscriber-name" /> + <xml-property name="indexedProps" value="subscriber-name,global-customer-id,subscriber-type" /> + <xml-property name="searchable" value="global-customer-id,subscriber-name" /> + <xml-property name="uniqueProps" value="global-customer-id" /> + <xml-property name="container" value="customers" /> + <xml-property name="namespace" value="business" /> + </xml-properties> + </java-type> + + <java-type name="ServiceSubscriptions"> + <xml-properties> + <xml-property name="description" value="Collection of objects that group service instances." /> + </xml-properties> + <xml-root-element name="service-subscriptions" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="serviceSubscription" name="service-subscription" type="inventory.aai.openecomp.org.v9.ServiceSubscription" /> + </java-attributes> + </java-type> + + <java-type name="ServiceSubscription"> + <xml-root-element name="service-subscription" /> + <java-attributes> + <xml-element java-attribute="serviceType" name="service-type" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Value defined by orchestration to identify this service across ECOMP." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="tempUbSubAccountId" name="temp-ub-sub-account-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="This property will be deleted from A&AI in the near future. Only stop gap solution." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceInstances" name="service-instances" type="inventory.aai.openecomp.org.v9.ServiceInstances"> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Object that group service instances." /> + <xml-property name="indexedProps" value="service-type" /> + <xml-property name="dependentOn" value="customer" /> + <xml-property name="container" value="service-subscriptions" /> + <xml-property name="crossEntityReference" value="service-instance,service-type" /> + </xml-properties> + </java-type> + + <java-type name="ServiceInstances"> + <xml-properties> + <xml-property name="description" value="Collection of service instances" /> + </xml-properties> + <xml-root-element name="service-instances" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="serviceInstance" name="service-instance" type="inventory.aai.openecomp.org.v9.ServiceInstance" /> + </java-attributes> + </java-type> + + <java-type name="ServiceInstance"> + <xml-root-element name="service-instance" /> + <java-attributes> + <xml-element java-attribute="serviceInstanceId" name="service-instance-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Uniquely identifies this instance of a service" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceInstanceName" name="service-instance-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="This field will store a name assigned to the service-instance." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelId" name="persona-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model id for this resource or service model." /> + <xml-property name="dbAlias" value="model-invariant-id-local" /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="internal" /> + <xml-property name="dbAlias" value="model-version-id-local" /> + <xml-property name="dataCopy" value="service-design-and-creation/models/model/{persona-model-id}/model-vers?model-version={persona-model-version}#model-version-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&AI widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthTotal" name="bandwidth-total" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indicates the total bandwidth to be used for this service." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthUpWan1" name="bandwidth-up-wan1" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="indicates the upstream bandwidth this service will use on the WAN1 port of the physical device." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthDownWan1" name="bandwidth-down-wan1" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="indicates the downstream bandwidth this service will use on the WAN1 port of the physical device." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthUpWan2" name="bandwidth-up-wan2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="indicates the upstream bandwidth this service will use on the WAN2 port of the physical device." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthDownWan2" name="bandwidth-down-wan2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="indicates the downstream bandwidth this service will use on the WAN2 port of the physical device." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vhnPortalUrl" name="vhn-portal-url" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL customers will use to access the vHN Portal." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceInstanceLocationId" name="service-instance-location-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="An identifier that customers assign to the location where this service is being used." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="selflink" name="selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Path to the controller object." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this service." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="metadata" name="metadata" type="inventory.aai.openecomp.org.v9.Metadata" /> + <xml-element java-attribute="allottedResources" name="allotted-resources" type="inventory.aai.openecomp.org.v9.AllottedResources" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Instance of a service" /> + <xml-property name="indexedProps" value="service-instance-id,persona-model-id,persona-model-version,widget-model-id,widget-model-version,service-instance-name,service-instance-location-id,orchestration-status" /> + <xml-property name="nameProps" value="service-instance-name" /> + <xml-property name="searchable" value="service-instance-id,service-instance-name" /> + <xml-property name="uniqueProps" value="service-instance-id" /> + <xml-property name="dependentOn" value="service-subscription" /> + <xml-property name="container" value="service-instances" /> + </xml-properties> + </java-type> + <java-type name="ServiceDesignAndCreation"> <xml-properties> <xml-property name="description" value="Namespace for objects managed by ASDC" /> </xml-properties> <xml-root-element name="service-design-and-creation" /> <java-attributes> + <xml-element java-attribute="vnfImages" name="vnf-images" type="inventory.aai.openecomp.org.v9.VnfImages" /> + <xml-element java-attribute="services" name="services" type="inventory.aai.openecomp.org.v9.Services" /> + <xml-element java-attribute="serviceCapabilities" name="service-capabilities" type="inventory.aai.openecomp.org.v9.ServiceCapabilities" /> <xml-element java-attribute="models" name="models" type="inventory.aai.openecomp.org.v9.Models" /> + <xml-element java-attribute="namedQueries" name="named-queries" type="inventory.aai.openecomp.org.v9.NamedQueries" /> </java-attributes> </java-type> - <java-type name="Models"> + + <java-type name="VnfImages"> <xml-properties> - <xml-property name="description" value="Collection of subgraph definitions provided by ASDC to describe the inventory assets and their connections related to ASDC models" /> + <xml-property name="description" value="Collection of image objects that pertain to a VNF that doesn't have associated vservers. This is a kludge." /> </xml-properties> - <xml-root-element name="models" /> + <xml-root-element name="vnf-images" /> <java-attributes> - <xml-element container-type="java.util.ArrayList" java-attribute="model" name="model" type="inventory.aai.openecomp.org.v9.Model" /> + <xml-element container-type="java.util.ArrayList" java-attribute="vnfImage" name="vnf-image" type="inventory.aai.openecomp.org.v9.VnfImage" /> </java-attributes> </java-type> - <java-type name="Model"> - <xml-root-element name="model" /> + <java-type name="VnfImage"> + <xml-root-element name="vnf-image" /> + <java-attributes> + <xml-element java-attribute="vnfImageUuid" name="vnf-image-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID of this asset" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="application" name="application" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The application that the image instantiates." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="applicationVendor" name="application-vendor" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The vendor of the application." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="applicationVersion" name="application-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The version of the application." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="selflink" name="selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> <xml-properties> - <xml-property name="description" value="Subgraph definition provided by ASDC to describe an inventory asset and its connections related to ASDC models, independent of version" /> - <xml-property name="nameProps" value="model-type" /> - <xml-property name="indexedProps" value="model-invariant-id,model-type" /> - <xml-property name="uniqueProps" value="model-invariant-id" /> - <xml-property name="container" value="models" /> + <xml-property name="description" value="Image object that pertain to a VNF that doesn't have associated vservers. This is a kludge." /> + <xml-property name="indexedProps" value="application,vnf-image-uuid,application-vendor,application-version" /> + <xml-property name="uniqueProps" value="vnf-image-uuid" /> + <xml-property name="container" value="vnf-images" /> <xml-property name="namespace" value="service-design-and-creation" /> </xml-properties> + </java-type> + + <java-type name="Services"> + <xml-properties> + <xml-property name="description" value="Collection of service model definitions. Likely to be deprecated in favor of models from ASDC." /> + </xml-properties> + <xml-root-element name="services" /> <java-attributes> - <xml-element java-attribute="modelInvariantId" name="model-invariant-id" required="true" type="java.lang.String" xml-key="true"> + <xml-element container-type="java.util.ArrayList" java-attribute="service" name="service" type="inventory.aai.openecomp.org.v9.Service" /> + </java-attributes> + </java-type> + + <java-type name="Service"> + <xml-root-element name="service" /> + <java-attributes> + <xml-element java-attribute="serviceId" name="service-id" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="Unique identifier corresponding to the main definition of a model in ASDC" /> + <xml-property name="description" value="This gets defined by others to provide a unique ID for the service, we accept what is sent." /> </xml-properties> </xml-element> - <xml-element java-attribute="modelType" name="model-type" required="true" type="java.lang.String"> + <xml-element java-attribute="serviceDescription" name="service-description" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Type of the model, e.g., service, resource, widget, etc." /> + <xml-property name="description" value="Description of the service" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceSelflink" name="service-selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="URL to endpoint where AAI can get more details" /> </xml-properties> </xml-element> <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> @@ -85,46 +2256,129 @@ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> </xml-properties> </xml-element> - <xml-element java-attribute="modelVers" name="model-vers" type="inventory.aai.openecomp.org.v9.ModelVers" /> + <xml-element java-attribute="serviceVersion" name="service-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="service version" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> </java-attributes> + <xml-properties> + <xml-property name="description" value="Stand-in for service model definitions. Likely to be deprecated in favor of models from ASDC. Does not strictly map to ASDC services." /> + <xml-property name="indexedProps" value="service-description,service-id" /> + <xml-property name="container" value="services" /> + <xml-property name="namespace" value="service-design-and-creation" /> + </xml-properties> </java-type> + <java-type name="ServiceCapabilities"> + <xml-properties> + <xml-property name="description" value="Collection of service capabilities." /> + </xml-properties> + <xml-root-element name="service-capabilities" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="serviceCapability" name="service-capability" type="inventory.aai.openecomp.org.v9.ServiceCapability" /> + </java-attributes> + </java-type> - <java-type name="ModelVers"> - <xml-root-element name="model-vers" /> + <java-type name="ServiceCapability"> + <xml-root-element name="service-capability" /> <java-attributes> - <xml-element container-type="java.util.ArrayList" java-attribute="modelVer" name="model-ver" type="inventory.aai.openecomp.org.v9.ModelVer" /> + <xml-element java-attribute="serviceType" name="service-type" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="This gets defined by others to provide a unique ID for the service, we accept what is sent." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> </java-attributes> + <xml-properties> + <xml-property name="description" value="Early definition of server/resource pairings, likely to be replaced by models. No new use should be made of this." /> + <xml-property name="indexedProps" value="service-type,vnf-type" /> + <xml-property name="container" value="service-capabilities" /> + <xml-property name="namespace" value="service-design-and-creation" /> + </xml-properties> </java-type> - - <java-type name="ModelVer"> - <xml-root-element name="model-ver" /> + + <java-type name="Network"> <xml-properties> - <xml-property name="description" value="Subgraph definition provided by ASDC to describe a specific version of an inventory asset and its connections related to ASDC models" /> - <xml-property name="nameProps" value="model-name" /> - <xml-property name="indexedProps" value="model-version-id,model-name,model-version" /> - <xml-property name="uniqueProps" value="model-version-id" /> - <xml-property name="container" value="model-vers" /> + <xml-property name="description" value="Namespace for network inventory resources." /> </xml-properties> + <xml-root-element name="network" /> <java-attributes> - <xml-element java-attribute="modelVersionId" name="model-version-id" required="true" type="java.lang.String" xml-key="true"> + <xml-element java-attribute="logicalLinks" name="logical-links" type="inventory.aai.openecomp.org.v9.LogicalLinks" /> + <xml-element java-attribute="sitePairSets" name="site-pair-sets" type="inventory.aai.openecomp.org.v9.SitePairSets" /> + <xml-element java-attribute="vpnBindings" name="vpn-bindings" type="inventory.aai.openecomp.org.v9.VpnBindings" /> + <xml-element java-attribute="vplsPes" name="vpls-pes" type="inventory.aai.openecomp.org.v9.VplsPes" /> + <xml-element java-attribute="multicastConfigurations" name="multicast-configurations" type="inventory.aai.openecomp.org.v9.MulticastConfigurations" /> + <xml-element java-attribute="vces" name="vces" type="inventory.aai.openecomp.org.v9.Vces" /> + <xml-element java-attribute="vpes" name="vpes" type="inventory.aai.openecomp.org.v9.Vpes" /> + <xml-element java-attribute="vnfcs" name="vnfcs" type="inventory.aai.openecomp.org.v9.Vnfcs" /> + <xml-element java-attribute="l3Networks" name="l3-networks" type="inventory.aai.openecomp.org.v9.L3Networks" /> + <xml-element java-attribute="networkPolicies" name="network-policies" type="inventory.aai.openecomp.org.v9.NetworkPolicies" /> + <xml-element java-attribute="genericVnfs" name="generic-vnfs" type="inventory.aai.openecomp.org.v9.GenericVnfs" /> + <xml-element java-attribute="lagLinks" name="lag-links" type="inventory.aai.openecomp.org.v9.LagLinks" /> + <xml-element java-attribute="newvces" name="newvces" type="inventory.aai.openecomp.org.v9.Newvces" /> + <xml-element java-attribute="pnfs" name="pnfs" type="inventory.aai.openecomp.org.v9.Pnfs" /> + <xml-element java-attribute="physicalLinks" name="physical-links" type="inventory.aai.openecomp.org.v9.PhysicalLinks" /> + <xml-element java-attribute="ipsecConfigurations" name="ipsec-configurations" type="inventory.aai.openecomp.org.v9.IpsecConfigurations" /> + <xml-element java-attribute="routeTableReferences" name="route-table-references" type="inventory.aai.openecomp.org.v9.RouteTableReferences" /> + <xml-element java-attribute="instanceGroups" name="instance-groups" type="inventory.aai.openecomp.org.v9.InstanceGroups" /> + <xml-element java-attribute="zones" name="zones" type="inventory.aai.openecomp.org.v9.Zones" /> + <xml-element java-attribute="testObjects" name="test-objects" type="inventory.aai.openecomp.org.v9.TestObjects" /> + </java-attributes> + </java-type> + + <java-type name="LogicalLinks"> + <xml-properties> + <xml-property name="description" value="Collection of logical connections" /> + </xml-properties> + <xml-root-element name="logical-links" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="logicalLink" name="logical-link" type="inventory.aai.openecomp.org.v9.LogicalLink" /> + </java-attributes> + </java-type> + + <java-type name="LogicalLink"> + <xml-root-element name="logical-link" /> + <java-attributes> + <xml-element java-attribute="linkName" name="link-name" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="Unique identifier corresponding to one version of a model in ASDC" /> + <xml-property name="description" value="e.g., evc-name, or vnf-nameA_interface-nameA_vnf-nameZ_interface-nameZ" /> </xml-properties> </xml-element> - <xml-element java-attribute="modelName" name="model-name" required="true" type="java.lang.String"> + <xml-element java-attribute="linkType" name="link-type" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Name of the model, which can change from version to version." /> + <xml-property name="description" value="Type of logical link, e.g., evc" /> </xml-properties> </xml-element> - <xml-element java-attribute="modelVersion" name="model-version" required="true" type="java.lang.String"> + <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Version" /> + <xml-property name="description" value="Captures the numeric part of the speed" /> </xml-properties> </xml-element> - <xml-element java-attribute="modelDescription" name="model-description" type="java.lang.String"> + <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Description" /> + <xml-property name="description" value="Captures the units corresponding to the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipVersion" name="ip-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="v4, v6, or ds for dual stack" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="routingProtocol" name="routing-protocol" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="For example, static or BGP" /> </xml-properties> </xml-element> <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> @@ -132,21 +2386,1203 @@ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> </xml-properties> </xml-element> + <xml-element java-attribute="personaModelId" name="persona-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model id for this resource or service model." /> + <xml-property name="dbAlias" value="model-invariant-id-local" /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="internal" /> + <xml-property name="dbAlias" value="model-version-id-local" /> + <xml-property name="dataCopy" value="service-design-and-creation/models/model/{persona-model-id}/model-vers?model-version={persona-model-version}#model-version-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&AI widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="operationalStatus" name="operational-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indication of operational status of the logical link." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this VNF by BAU Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="linkRole" name="link-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indication of the network use of the logical link." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="linkName2" name="link-name2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Alias or alternate name (CLCI or D1 name)." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="linkId" name="link-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="UUID of the logical-link, SDNC generates this." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="circuitId" name="circuit-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Circuit id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="purpose" name="purpose" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Reason for this entity, role it is playing" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> </java-attributes> + <xml-properties> + <xml-property name="description" value="Logical links generally connect l-interfaces but are used to express logical connectivity between two points" /> + <xml-property name="indexedProps" value="link-name,persona-model-id,persona-model-version,widget-model-id,widget-model-version,link-id,prov-status,circuit-id,purpose" /> + <xml-property name="uniqueProps" value="link-id" /> + <xml-property name="container" value="logical-links" /> + <xml-property name="namespace" value="network" /> + <xml-property name="searchable" value="link-name" /> + </xml-properties> </java-type> - <java-type name="TestObjects"> - <xml-root-element name="test-objects" /> + + <java-type name="SitePairSets"> + <xml-properties> + <xml-property name="description" value="Collection of sets of instances for probes related to generic-vnf" /> + </xml-properties> + <xml-root-element name="site-pair-sets" /> <java-attributes> - <xml-element container-type="java.util.ArrayList" java-attribute="testObject" name="test-object" type="inventory.aai.openecomp.org.v9.TestObject" /> + <xml-element container-type="java.util.ArrayList" java-attribute="sitePairSet" name="site-pair-set" type="inventory.aai.openecomp.org.v9.SitePairSet" /> + </java-attributes> + </java-type> + + <java-type name="SitePairSet"> + <xml-root-element name="site-pair-set" /> + <java-attributes> + <xml-element java-attribute="sitePairSetId" name="site-pair-set-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of site pair set." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="routingInstances" name="routing-instances" type="inventory.aai.openecomp.org.v9.RoutingInstances" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> </java-attributes> <xml-properties> - <xml-property name="maximumDepth" value="0" /> + <xml-property name="description" value="Set of instances for probes used to measure service level agreements" /> + <xml-property name="indexedProps" value="site-pair-set-id" /> + <xml-property name="uniqueProps" value="site-pair-set-id" /> + <xml-property name="container" value="site-pair-sets" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + + <java-type name="RoutingInstances"> + <xml-properties> + <xml-property name="description" value="set of probes related to generic-vnf routing instance" /> + </xml-properties> + <xml-root-element name="routing-instances" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="routingInstance" name="routing-instance" type="inventory.aai.openecomp.org.v9.RoutingInstance" /> + </java-attributes> + </java-type> + + <java-type name="RoutingInstance"> + <xml-root-element name="routing-instance" /> + <java-attributes> + <xml-element java-attribute="routingInstanceId" name="routing-instance-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of routing instance" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="rpmOwner" name="rpm-owner" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="rpm owner" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="sitePairs" name="site-pairs" type="inventory.aai.openecomp.org.v9.SitePairs" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="indexedProps" value="routing-instance-id" /> + <xml-property name="uniqueProps" value="routing-instance-id" /> + <xml-property name="dependentOn" value="site-pair-set" /> + <xml-property name="container" value="routing-instances" /> + </xml-properties> + </java-type> + + <java-type name="SitePairs"> + <xml-properties> + <xml-property name="description" value="probe within a set" /> + </xml-properties> + <xml-root-element name="site-pairs" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="sitePair" name="site-pair" type="inventory.aai.openecomp.org.v9.SitePair" /> + </java-attributes> + </java-type> + + <java-type name="SitePair"> + <xml-root-element name="site-pair" /> + <java-attributes> + <xml-element java-attribute="sitePairId" name="site-pair-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="unique identifier of probe" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="sourceIp" name="source-ip" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Prefix address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="destinationIp" name="destination-ip" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Prefix address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipVersion" name="ip-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="ip version, v4, v6" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="destinationHostname" name="destination-hostname" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Hostname of the destination equipment to which SLAs are measured against." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="destinationEquipType" name="destination-equip-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The type of destinatination equipment. Could be Router, etc." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="classesOfService" name="classes-of-service" type="inventory.aai.openecomp.org.v9.ClassesOfService" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="indexedProps" value="site-pair-id" /> + <xml-property name="uniqueProps" value="site-pair-id" /> + <xml-property name="dependentOn" value="routing-instance" /> + <xml-property name="container" value="site-pairs" /> + </xml-properties> + </java-type> + + <java-type name="ClassesOfService"> + <xml-properties> + <xml-property name="description" value="class-of-service of probe" /> + </xml-properties> + <xml-root-element name="classes-of-service" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="classOfService" name="class-of-service" type="inventory.aai.openecomp.org.v9.ClassOfService" /> + </java-attributes> + </java-type> + + <java-type name="ClassOfService"> + <xml-root-element name="class-of-service" /> + <java-attributes> + <xml-element java-attribute="cos" name="cos" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="unique identifier of probe" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="probeId" name="probe-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="identifier of probe" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="probeType" name="probe-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="type of probe" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="indexedProps" value="cos" /> + <xml-property name="dependentOn" value="site-pair" /> + <xml-property name="container" value="classes-of-service" /> + </xml-properties> + </java-type> + + <java-type name="VpnBindings"> + <xml-root-element name="vpn-bindings" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="vpnBinding" name="vpn-binding" type="inventory.aai.openecomp.org.v9.VpnBinding" /> + </java-attributes> + </java-type> + + <java-type name="VpnBinding"> + <xml-root-element name="vpn-binding" /> + <java-attributes> + <xml-element java-attribute="vpnId" name="vpn-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="VPN ID, globally unique within A&AI" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vpnName" name="vpn-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="VPN Name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="globalRouteTarget" name="global-route-target" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Number used to identify a VPN, globally unique in the network" /> + <xml-property name="dataLink" value="./route-targets/route-target/{global-route-target}/{route-target-role}" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vpnPlatform" name="vpn-platform" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the platform associated with the VPN example AVPN, Mobility" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vpnType" name="vpn-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Type of the vpn, should be taken from enumerated/valid values" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="routeDistinguisher" name="route-distinguisher" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used to distinguish the distinct VPN routes of separate customers who connect to the provider in an MPLS network." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="routeTargetRole" name="route-target-role" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Role assigned to this route target" /> + <xml-property name="dataLink" value="./route-targets/route-target/{global-route-target}/{route-target-role}" /> + <xml-property name="defaultValue" value="BOTH" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList"> + <xml-properties> + <xml-property name="description" value="l3-networks relate to vpn-bindings" /> + </xml-properties> + </xml-element> + </java-attributes> + <xml-properties> + <xml-property name="description" value="VPN binding" /> + <xml-property name="nameProps" value="vpn-name,vpn-type" /> + <xml-property name="indexedProps" value="vpn-name,vpn-id,global-route-target,vpn-type" /> + <xml-property name="searchable" value="vpn-id,vpn-name" /> + <xml-property name="uniqueProps" value="vpn-id" /> + <xml-property name="container" value="vpn-bindings" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + + <java-type name="VplsPes"> + <xml-properties> + <xml-property name="description" value="Collection of VPLS Provider Edge routers" /> + </xml-properties> + <xml-root-element name="vpls-pes" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="vplsPe" name="vpls-pe" type="inventory.aai.openecomp.org.v9.VplsPe" /> + </java-attributes> + </java-type> + + <java-type name="VplsPe"> + <xml-root-element name="vpls-pe" /> + <java-attributes> + <xml-element java-attribute="equipmentName" name="equipment-name" required="true" type="java.lang.String" xml-key="true" /> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this VNF by BAU Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address)." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Client should send valid enumerated value, e.g., VPLS-PE." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Temporary location for stag to get to VCE" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="pInterfaces" name="p-interfaces" type="inventory.aai.openecomp.org.v9.PInterfaces" /> + <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.openecomp.org.v9.LagInterfaces" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="VPLS Provider Edge routers." /> + <xml-property name="indexedProps" value="prov-status,equipment-name" /> + <xml-property name="container" value="vpls-pes" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + + <java-type name="MulticastConfigurations"> + <xml-properties> + <xml-property name="description" value="multicast configuration of generic-vnf ip-address" /> + </xml-properties> + <xml-root-element name="multicast-configurations" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="multicastConfiguration" name="multicast-configuration" type="inventory.aai.openecomp.org.v9.MulticastConfiguration" /> + </java-attributes> + </java-type> + + <java-type name="MulticastConfiguration"> + <xml-root-element name="multicast-configuration" /> + <java-attributes> + <xml-element java-attribute="multicastConfigurationId" name="multicast-configuration-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of multicast configuration." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="multicastProtocol" name="multicast-protocol" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="protocol of multicast configuration" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="rpType" name="rp-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="rp type of multicast configuration" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="indexedProps" value="multicast-configuration-id" /> + <xml-property name="uniqueProps" value="multicast-configuration-id" /> + <xml-property name="container" value="multicast-configurations" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + + <java-type name="Vces"> + <xml-properties> + <xml-property name="description" value="Collection of Virtual Customer Edge Routers, used specifically for Gamma. This object is deprecated." /> + </xml-properties> + <xml-root-element name="vces" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="vce" name="vce" type="inventory.aai.openecomp.org.v9.Vce" /> + </java-attributes> + </java-type> + + <java-type name="Vce"> + <xml-root-element name="vce" /> + <java-attributes> + <xml-element java-attribute="vnfId" name="vnf-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of VNF. This is unique across the graph." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfName" name="vnf-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of VNF." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfName2" name="vnf-name2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Alternate name of VNF." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceId" name="service-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Unique identifier of service, does not strictly map to ASDC services, SOON TO BE DEPRECATED." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="regionalResourceZone" name="regional-resource-zone" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Regional way of organizing pservers, source of truth should define values" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="operationalState" name="operational-state" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indicator for whether the resource is considered operational" /> + <xml-property name="dbAlias" value="operational-status" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="licenseKey" name="license-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="OBSOLETE - do not use" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Network role being played by this VNF" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vpeId" name="vpe-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Unique ID of VPE connected to this VCE." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="v6VceWanAddress" name="v6-vce-wan-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Valid v6 IP address for the WAN Link on this router. Implied length of /64." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Address tail-f uses to configure vce, also used for troubleshooting and is IP used for traps generated by VCE." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4Loopback0Address" name="ipv4-loopback0-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Loopback0 address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="entitlementResourceUuid" name="entitlement-resource-uuid" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="OBSOLETE - see child relationships" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="portGroups" name="port-groups" type="inventory.aai.openecomp.org.v9.PortGroups" /> + <xml-element java-attribute="licenses" name="licenses" type="inventory.aai.openecomp.org.v9.Licenses" /> + <xml-element java-attribute="entitlements" name="entitlements" type="inventory.aai.openecomp.org.v9.Entitlements" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Virtual Customer Edge Router, used specifically for Gamma. This object is deprecated." /> + <xml-property name="nameProps" value="vnf-name" /> + <xml-property name="indexedProps" value="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,interface-name,regional-resource-zone,vpe-id,prov-status,service-id" /> + <xml-property name="searchable" value="vnf-id,vnf-name,vnf-name2" /> + <xml-property name="uniqueProps" value="vnf-id" /> + <xml-property name="container" value="vces" /> + <xml-property name="namespace" value="network" /> + <xml-property name="extends" value="vnf" /> + </xml-properties> + </java-type> + + <java-type name="PortGroups"> + <xml-root-element name="port-groups" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="portGroup" name="port-group" type="inventory.aai.openecomp.org.v9.PortGroup" /> + </java-attributes> + </java-type> + + <java-type name="PortGroup"> + <xml-root-element name="port-group" /> + <java-attributes> + <xml-element java-attribute="interfaceId" name="interface-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID of the interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron network id of this Interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronNetworkName" name="neutron-network-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron network name of this Interface" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Role assigned to this Interface, should use values as defined in ECOMP Yang models." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="portGroupId" name="port-group-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Unique ID for port group in vmware" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="portGroupName" name="port-group-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Likely to duplicate value of neutron network name" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="switchName" name="switch-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="DVS or standard switch name (should be non-null for port groups associated with DVS)" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="cvlanTags" name="cvlan-tags" type="inventory.aai.openecomp.org.v9.CvlanTags" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Used to capture the network interfaces of this VCE" /> + <xml-property name="nameProps" value="port-group-name" /> + <xml-property name="indexedProps" value="port-group-id,heat-stack-id,interface-id,interface-name,switch-name" /> + <xml-property name="dependentOn" value="vce" /> + <xml-property name="container" value="port-groups" /> + </xml-properties> + </java-type> + + <java-type name="CvlanTags"> + <xml-root-element name="cvlan-tags" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="cvlanTagEntry" name="cvlan-tag-entry" type="inventory.aai.openecomp.org.v9.CvlanTagEntry" /> + </java-attributes> + </java-type> + + <java-type name="CvlanTagEntry"> + <xml-root-element name="cvlan-tag-entry" /> + <java-attributes> + <xml-element java-attribute="cvlanTag" name="cvlan-tag" required="true" type="java.lang.Long" xml-key="true"> + <xml-properties> + <xml-property name="description" value="See mis-na-virtualization-platform.yang" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="dependentOn" value="port-group" /> + <xml-property name="indexedProps" value="cvlan-tag" /> + <xml-property name="container" value="cvlan-tags" /> + </xml-properties> + </java-type> + + <java-type name="Vpes"> + <xml-properties> + <xml-property name="description" value="Virtual provider edge router. In 1504, A&AI will populate this object through an M&P and tool provided to operations." /> + </xml-properties> + <xml-root-element name="vpes" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="vpe" name="vpe" type="inventory.aai.openecomp.org.v9.Vpe" /> + </java-attributes> + </java-type> + + <java-type name="Vpe"> + <xml-root-element name="vpe" /> + <java-attributes> + <xml-element java-attribute="vnfId" name="vnf-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of VNF. This is unique across the graph." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfName" name="vnf-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of VNF." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfName2" name="vnf-name2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Alternate name of VNF." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceId" name="service-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Unique identifier of service. Does not map strictly to ASDC services. SOON TO BE DEPRECATED" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="regionalResourceZone" name="regional-resource-zone" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Regional way of organizing pservers, source of truth should define values" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="operationalState" name="operational-state" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indicator for whether the resource is considered operational" /> + <xml-property name="dbAlias" value="operational-status" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="licenseKey" name="license-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="OBSOLETE - do not use. See child relationships." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Client should send valid enumerated value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address)." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamGatewayAddressPrefixLength" name="ipv4-oam-gateway-address-prefix-length" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="Prefix length for oam-address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamGatewayAddress" name="ipv4-oam-gateway-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Gateway address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="v4Loopback0IpAddress" name="v4-loopback0-ip-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Loopback0 address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vlanIdOuter" name="vlan-id-outer" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="Temporary location for stag to get to VCE" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="asNumber" name="as-number" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="as-number of the VPE" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="summaryStatus" name="summary-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="details regarding the vpe operation, PLEASE DISCONTINUE USE OF THIS FIELD." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="encryptedAccessFlag" name="encrypted-access-flag" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="indicates whether vpe access uses SSH" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.openecomp.org.v9.LInterfaces" /> + <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.openecomp.org.v9.LagInterfaces" /> + <xml-element java-attribute="licenses" name="licenses" type="inventory.aai.openecomp.org.v9.Licenses" /> + <xml-element java-attribute="entitlements" name="entitlements" type="inventory.aai.openecomp.org.v9.Entitlements" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Relationship-list must include related to info for complex." /> + <xml-property name="nameProps" value="vnf-name" /> + <xml-property name="indexedProps" value="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,regional-resource-zone,prov-status,service-id" /> + <xml-property name="searchable" value="vnf-id,vnf-name,vnf-name2" /> + <xml-property name="uniqueProps" value="vnf-id" /> + <xml-property name="container" value="vpes" /> + <xml-property name="namespace" value="network" /> + <xml-property name="extends" value="vnf" /> + </xml-properties> + </java-type> + + <java-type name="Vnfcs"> + <xml-properties> + <xml-property name="description" value="virtual network components associated with a vserver from application controller." /> + </xml-properties> + <xml-root-element name="vnfcs" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="vnfc" name="vnfc" type="inventory.aai.openecomp.org.v9.Vnfc" /> + </java-attributes> + </java-type> + + <java-type name="Vnfc"> + <xml-root-element name="vnfc" /> + <java-attributes> + <xml-element java-attribute="vnfcName" name="vnfc-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID of vnfc." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfcFunctionCode" name="vnfc-function-code" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="function code" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfcType" name="vnfc-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="type" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="prov status of this vnfc" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this VNF, mastered by APP-C" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV4OamVip" name="ipaddress-v4-oam-vip" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Oam V4 vip address of this vnfc" /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)" /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="isClosedLoopDisabled" name="is-closed-loop-disabled" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="used to indicate whether closed loop function is enabled on this node" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="groupNotation" name="group-notation" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Group notation of VNFC" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="indexedProps" value="vnfc-name,prov-status,vnfc-type,vnfc-function-code,ipaddress-v4-oam-vip,in-maint,is-closed-loop-disabled,group-notation" /> + <xml-property name="searchable" value="vnfc-name" /> + <xml-property name="container" value="vnfcs" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + + <java-type name="L3Networks"> + <xml-root-element name="l3-networks" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="l3Network" name="l3-network" type="inventory.aai.openecomp.org.v9.L3Network" /> + </java-attributes> + </java-type> + + <java-type name="L3Network"> + <xml-root-element name="l3-network" /> + <java-attributes> + <xml-element java-attribute="networkId" name="network-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Network ID, should be uuid. Unique across A&AI." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkName" name="network-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of the network, governed by some naming convention.." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkType" name="network-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Type of the network - who defines these values?" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkRole" name="network-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Role the network plans - who defines these values?" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkTechnology" name="network-technology" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Network technology - who defines these values?" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron network id of this Interface" /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="isBoundToVpn" name="is-bound-to-vpn" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="Set to true if bound to VPN" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceId" name="service-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Unique identifier of service from ASDC. Does not strictly map to ASDC services. SOON TO BE DEPRECATED" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkRoleInstance" name="network-role-instance" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="network role instance" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="contrailNetworkFqdn" name="contrail-network-fqdn" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Contrail FQDN for the network" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelId" name="persona-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model id for this resource or service model." /> + <xml-property name="dbAlias" value="model-invariant-id-local" /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="internal" /> + <xml-property name="dbAlias" value="model-version-id-local" /> + <xml-property name="dataCopy" value="service-design-and-creation/models/model/{persona-model-id}/model-vers?model-version={persona-model-version}#model-version-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelCustomizationId" name="persona-model-customization-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="captures the id of all the configuration used to customize the resource for the service." /> + <xml-property name="dbAlias" value="model-customization-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&AI widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="physicalNetworkName" name="physical-network-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name associated with the physical network." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="isProviderNetwork" name="is-provider-network" required="true" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="boolean indicatating whether or not network is a provider network." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="isSharedNetwork" name="is-shared-network" required="true" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="boolean indicatating whether or not network is a shared network." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="isExternalNetwork" name="is-external-network" required="true" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="boolean indicatating whether or not network is an external network." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="selflink" name="selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Path to the controller object." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="subnets" name="subnets" type="inventory.aai.openecomp.org.v9.Subnets" /> + <xml-element java-attribute="ctagAssignments" name="ctag-assignments" type="inventory.aai.openecomp.org.v9.CtagAssignments" /> + <xml-element java-attribute="segmentationAssignments" name="segmentation-assignments" type="inventory.aai.openecomp.org.v9.SegmentationAssignments" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" > + <xml-properties> + <xml-property name="description" value="Relates to tenant (or is it a child of tenant), complex, service, vpn-binding" /> + </xml-properties> + </xml-element> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Generic network definition" /> + <xml-property name="nameProps" value="network-name" /> + <xml-property name="indexedProps" value="heat-stack-id,network-uuid,service-id,network-id,network-name,persona-model-id,persona-model-version,widget-model-id,widget-model-version,contrail-network-fqdn,network-role" /> + <xml-property name="searchable" value="network-id,network-name" /> + <xml-property name="uniqueProps" value="network-id" /> + <xml-property name="container" value="l3-networks" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + <java-type name="NetworkPolicies"> + <xml-root-element name="network-policies" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="networkPolicy" name="network-policy" type="inventory.aai.openecomp.org.v9.NetworkPolicy" /> + </java-attributes> + </java-type> + <java-type name="NetworkPolicy"> + <xml-root-element name="network-policy" /> + <java-attributes> + <xml-element java-attribute="networkPolicyId" name="network-policy-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="UUID representing unique key to this instance" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkPolicyFqdn" name="network-policy-fqdn" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Contrail FQDN for the policy" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="ID for the openStack Heat instance" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="nameProps" value="network-policy-fqdn" /> + <xml-property name="indexedProps" value="network-policy-id,network-policy-fqdn" /> + <xml-property name="searchable" value="network-policy-id,network-policy-fqdn" /> + <xml-property name="uniqueProps" value="network-policy-id" /> + <xml-property name="container" value="network-policies" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + <java-type name="CtagAssignments"> + <xml-root-element name="ctag-assignments" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="ctagAssignment" name="ctag-assignment" type="inventory.aai.openecomp.org.v9.CtagAssignment" /> + </java-attributes> + </java-type> + + <java-type name="CtagAssignment"> + <xml-root-element name="ctag-assignment" /> + <java-attributes> + <xml-element java-attribute="vlanIdInner" name="vlan-id-inner" required="true" type="java.lang.Long" xml-key="true"> + <xml-properties> + <xml-property name="description" value="id." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="indexedProps" value="vlan-id-inner" /> + <xml-property name="dependentOn" value="l3-network" /> + <xml-property name="container" value="ctag-assignments" /> + </xml-properties> + </java-type> + + <java-type name="Subnets"> + <xml-root-element name="subnets" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="subnet" name="subnet" type="inventory.aai.openecomp.org.v9.Subnet" /> + </java-attributes> + </java-type> + + <java-type name="Subnet"> + <xml-root-element name="subnet" /> + <java-attributes> + <xml-element java-attribute="subnetId" name="subnet-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Subnet ID, should be UUID." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="subnetName" name="subnet-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name associated with the subnet." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="neutronSubnetId" name="neutron-subnet-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Neutron id of this subnet" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="gatewayAddress" name="gateway-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="gateway ip address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="networkStartAddress" name="network-start-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="network start address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="cidrMask" name="cidr-mask" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="cidr mask" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipVersion" name="ip-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="ip version" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="dhcpEnabled" name="dhcp-enabled" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="dhcp enabled" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="dhcpStart" name="dhcp-start" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the start address reserved for use by dhcp" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="dhcpEnd" name="dhcp-end" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the last address reserved for use by dhcp" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="indexedProps" value="subnet-id,subnet-name" /> + <xml-property name="nameProps" value="subnet-name" /> + <xml-property name="uniqueProps" value="subnet-id" /> + <xml-property name="dependentOn" value="l3-network" /> + <xml-property name="container" value="subnets" /> + </xml-properties> + </java-type> + + <java-type name="GenericVnfs"> + <xml-properties> <xml-property name="description" value="Collection of VNFs" /> </xml-properties> + <xml-root-element name="generic-vnfs" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="genericVnf" name="generic-vnf" type="inventory.aai.openecomp.org.v9.GenericVnf" /> + </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + </xml-properties> </java-type> - <java-type name="TestObject"> - <xml-root-element name="test-object" /> + <java-type name="GenericVnf"> + <xml-root-element name="generic-vnf" /> <java-attributes> <xml-element java-attribute="vnfId" name="vnf-id" required="true" type="java.lang.String" xml-key="true"> <xml-properties> @@ -186,6 +3622,7 @@ <xml-element java-attribute="operationalState" name="operational-state" type="java.lang.String"> <xml-properties> <xml-property name="description" value="Indicator for whether the resource is considered operational. Valid values are in-service-path and out-of-service-path." /> + <xml-property name="dbAlias" value="operational-status" /> </xml-properties> </xml-element> <xml-element java-attribute="licenseKey" name="license-key" type="java.lang.String"> @@ -220,7 +3657,7 @@ </xml-element> <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Address tail-f uses to configure test-object, also used for troubleshooting and is IP used for traps generated by test-object." /> + <xml-property name="description" value="Address tail-f uses to configure generic-vnf, also used for troubleshooting and is IP used for traps generated by generic-vnf." /> </xml-properties> </xml-element> <xml-element java-attribute="ipv4Loopback0Address" name="ipv4-loopback0-address" type="java.lang.String"> @@ -287,7 +3724,7 @@ </xml-element> <xml-element java-attribute="summaryStatus" name="summary-status" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="details regarding the test-object operation, PLEASE DISCONTINUE USE OF THIS FIELD." /> + <xml-property name="description" value="details regarding the generic-vnf operation, PLEASE DISCONTINUE USE OF THIS FIELD." /> </xml-properties> </xml-element> <xml-element java-attribute="encryptedAccessFlag" name="encrypted-access-flag" type="java.lang.Boolean"> @@ -319,11 +3756,13 @@ <xml-properties> <xml-property name="description" value="the ASDC model id for this resource or service model." /> <xml-property name="dbAlias" value="model-invariant-id-local" /> + <xml-property name="visibility" value="deployment" /> </xml-properties> </xml-element> <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String"> <xml-properties> <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="deployment" /> </xml-properties> </xml-element> <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String"> @@ -366,6 +3805,11 @@ </xml-properties> </xml-element> <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.openecomp.org.v9.LInterfaces" /> + <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.openecomp.org.v9.LagInterfaces" /> + <xml-element java-attribute="vfModules" name="vf-modules" type="inventory.aai.openecomp.org.v9.VfModules" /> + <xml-element java-attribute="licenses" name="licenses" type="inventory.aai.openecomp.org.v9.Licenses" /> + <xml-element java-attribute="entitlements" name="entitlements" type="inventory.aai.openecomp.org.v9.Entitlements" /> </java-attributes> <xml-properties> <xml-property name="description" value="General purpose VNF" /> @@ -373,40 +3817,49 @@ <xml-property name="indexedProps" value="is-closed-loop-disabled,vnf-name2,vnf-type,heat-stack-id,in-maint,vnf-name,vnf-id,regional-resource-zone,prov-status,service-id,persona-model-id,persona-model-version,widget-model-id,widget-model-version" /> <xml-property name="searchable" value="vnf-id,vnf-name,vnf-name2" /> <xml-property name="uniqueProps" value="vnf-id" /> - <xml-property name="container" value="test-objects" /> + <xml-property name="container" value="generic-vnfs" /> <xml-property name="namespace" value="network" /> <xml-property name="extends" value="vnf" /> </xml-properties> </java-type> - - <java-type name="PortGroups"> - <xml-root-element name="port-groups" /> + + <java-type name="VfModules"> + <xml-properties> + <xml-property name="description" value="Collection of vf-modules, a deployment unit of VNFCs" /> + </xml-properties> + <xml-root-element name="vf-modules" /> <java-attributes> - <xml-element container-type="java.util.ArrayList" java-attribute="portGroup" name="port-group" type="inventory.aai.openecomp.org.v9.PortGroup" /> + <xml-element container-type="java.util.ArrayList" java-attribute="vfModule" name="vf-module" type="inventory.aai.openecomp.org.v9.VfModule" /> </java-attributes> </java-type> - <java-type name="PortGroup"> - <xml-root-element name="port-group" /> + <java-type name="VfModule"> + <xml-root-element name="vf-module" /> <java-attributes> - <xml-element java-attribute="interfaceId" name="interface-id" required="true" type="java.lang.String" xml-key="true"> + <xml-element java-attribute="vfModuleId" name="vf-module-id" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="Unique ID of the interface" /> + <xml-property name="description" value="Unique ID of vf-module." /> </xml-properties> </xml-element> - <xml-element java-attribute="neutronNetworkId" name="neutron-network-id" type="java.lang.String"> + <xml-element java-attribute="vfModuleName" name="vf-module-name" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Neutron network id of this Interface" /> + <xml-property name="description" value="Name of vf-module" /> </xml-properties> </xml-element> - <xml-element java-attribute="neutronNetworkName" name="neutron-network-name" type="java.lang.String"> + <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Neutron network name of this Interface" /> + <xml-property name="description" value="Heat stack id corresponding to this instance." /> </xml-properties> </xml-element> - <xml-element java-attribute="interfaceRole" name="interface-role" type="java.lang.String"> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Role assigned to this Interface, should use values as defined in ECOMP Yang models." /> + <xml-property name="description" value="orchestration status of this vf-module, mastered by MSO" /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="isBaseVfModule" name="is-base-vf-module" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="used to indicate whether or not this object is base vf module" /> </xml-properties> </xml-element> <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> @@ -414,24 +3867,175 @@ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> </xml-properties> </xml-element> - <xml-element java-attribute="portGroupId" name="port-group-id" type="java.lang.String"> + <xml-element java-attribute="personaModelId" name="persona-model-id" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Unique ID for port group in vmware" /> + <xml-property name="description" value="the ASDC model id for this resource or service model." /> + <xml-property name="dbAlias" value="model-invariant-id-local" /> + <xml-property name="visibility" value="deployment" /> </xml-properties> </xml-element> - <xml-element java-attribute="portGroupName" name="port-group-name" type="java.lang.String"> + <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Likely to duplicate value of neutron network name" /> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="deployment" /> </xml-properties> </xml-element> - <xml-element java-attribute="switchName" name="switch-name" type="java.lang.String"> + <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="DVS or standard switch name (should be non-null for port groups associated with DVS)" /> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="internal" /> + <xml-property name="dbAlias" value="model-version-id-local" /> + <xml-property name="dataCopy" value="service-design-and-creation/models/model/{persona-model-id}/model-vers?model-version={persona-model-version}#model-version-id" /> </xml-properties> </xml-element> - <xml-element java-attribute="orchestrationStatus" name="orchestration-status" required="true" type="java.lang.String"> + <xml-element java-attribute="personaModelCustomizationId" name="persona-model-customization-id" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO" /> + <xml-property name="description" value="captures the id of all the configuration used to customize the resource for the service." /> + <xml-property name="dbAlias" value="model-customization-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&AI widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="contrailServiceInstanceFqdn" name="contrail-service-instance-fqdn" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the Contrail unique ID for a service-instance" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="moduleIndex" name="module-index" type="java.lang.Integer"> + <xml-properties> + <xml-property name="description" value="the index will track the number of modules of a given type that have been deployed in a VNF, starting with 0, and always choosing the lowest available digit" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="selflink" name="selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Path to the controller object." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="a deployment unit of VNFCs" /> + <xml-property name="indexedProps" value="vf-module-id,vf-module-name,heat-stack-id,persona-model-id,persona-model-version,widget-model-id,widget-model-version,contrail-service-instance-fqdn" /> + <xml-property name="searchable" value="vf-module-id,vf-module-name" /> + <xml-property name="dependentOn" value="generic-vnf" /> + <xml-property name="container" value="vf-modules" /> + </xml-properties> + </java-type> + + + <java-type name="LagLinks"> + <xml-properties> + <xml-property name="description" value="Collection of link aggregation connections" /> + </xml-properties> + <xml-root-element name="lag-links" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="lagLink" name="lag-link" type="inventory.aai.openecomp.org.v9.LagLink" /> + </java-attributes> + </java-type> + + <java-type name="LagLink"> + <xml-root-element name="lag-link" /> + <java-attributes> + <xml-element java-attribute="linkName" name="link-name" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Alphabetical concatenation of lag-interface names" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="LAG links can connect lag-interfaces" /> + <xml-property name="indexedProps" value="link-name" /> + <xml-property name="container" value="lag-links" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + + <java-type name="Newvces"> + <xml-properties> + <xml-property name="description" value="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce." /> + </xml-properties> + <xml-root-element name="newvces" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="newvce" name="newvce" type="inventory.aai.openecomp.org.v9.Newvce" /> + </java-attributes> + </java-type> + + <java-type name="Newvce"> + <xml-root-element name="newvce" /> + <java-attributes> + <xml-element java-attribute="vnfId2" name="vnf-id2" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of VNF, can't use same attribute name right now until we promote this new object" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfName" name="vnf-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of VNF." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfName2" name="vnf-name2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Alternate name of VNF." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this VNF by BAU Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="operationalState" name="operational-state" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indicator for whether the resource is considered operational" /> + <xml-property name="dbAlias" value="operational-status" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="licenseKey" name="license-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="OBSOLETE - do not use" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address)." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Client should send valid enumerated value, e.g., VPE." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4Loopback0Address" name="ipv4-loopback0-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="v4 Loopback0 address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this VNF, mastered by MSO." /> </xml-properties> </xml-element> <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> @@ -444,131 +4048,548 @@ <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" /> </xml-properties> </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="lInterfaces" name="l-interfaces" type="inventory.aai.openecomp.org.v9.LInterfaces" /> </java-attributes> <xml-properties> - <xml-property name="description" value="Used to capture the network interfaces of this VCE" /> - <xml-property name="nameProps" value="port-group-name" /> - <xml-property name="indexedProps" value="port-group-id,heat-stack-id,interface-id,interface-name,switch-name" /> - <xml-property name="dependentOn" value="vce" /> - <xml-property name="container" value="port-groups" /> + <xml-property name="description" value="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce." /> + <xml-property name="nameProps" value="vnf-name" /> + <xml-property name="indexedProps" value="vnf-name,vnf-name2,vnf-type,heat-stack-id,prov-status,vnf-id2" /> + <xml-property name="searchable" value="vnf-id2,vnf-name,vnf-name2" /> + <xml-property name="uniqueProps" value="vnf-id2" /> + <xml-property name="container" value="newvces" /> + <xml-property name="namespace" value="network" /> </xml-properties> </java-type> - <java-type name="RelationshipList"> - <xml-root-element name="relationship-list" /> + + <java-type name="Pnfs"> + <xml-properties> + <xml-property name="description" value="Collection of Physical Network Functions." /> + </xml-properties> + <xml-root-element name="pnfs" /> <java-attributes> - <xml-element container-type="java.util.ArrayList" java-attribute="relationship" name="relationship" type="inventory.aai.openecomp.org.v9.Relationship" /> + <xml-element container-type="java.util.ArrayList" java-attribute="pnf" name="pnf" type="inventory.aai.openecomp.org.v9.Pnf" /> </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + </xml-properties> </java-type> - <java-type name="Relationship"> - <xml-root-element name="relationship" /> + <java-type name="Pnf"> + <xml-root-element name="pnf" /> <java-attributes> - <xml-element java-attribute="relatedTo" name="related-to" type="java.lang.String"> + <xml-element java-attribute="pnfName" name="pnf-name" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="A keyword provided by A&AI to indicate type of node." /> + <xml-property name="description" value="unique name of Physical Network Function." /> </xml-properties> </xml-element> - <xml-element java-attribute="relatedLink" name="related-link" type="java.lang.String"> + <xml-element java-attribute="pnfName2" name="pnf-name2" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="URL to the object in A&AI." /> + <xml-property name="description" value="name of Physical Network Function." /> </xml-properties> </xml-element> - <xml-element container-type="java.util.ArrayList" java-attribute="relationshipData" name="relationship-data" type="inventory.aai.openecomp.org.v9.RelationshipData" /> - <xml-element container-type="java.util.ArrayList" java-attribute="relatedToProperty" name="related-to-property" type="inventory.aai.openecomp.org.v9.RelatedToProperty" /> + <xml-element java-attribute="pnfName2Source" name="pnf-name2-source" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="source of name2" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="pnfId" name="pnf-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="id of pnf" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipType" name="equip-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Equipment type. Source of truth should define valid values." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipVendor" name="equip-vendor" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Equipment vendor. Source of truth should define valid values." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipModel" name="equip-model" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Equipment model. Source of truth should define valid values." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="identifier of managed by company or customer" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV4Oam" name="ipaddress-v4-oam" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="ipv4-oam-address with new naming convention for IP addresses" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="swVersion" name="sw-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="sw-version is the version of SW for the hosted application on the PNF." /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="Used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="frameId" name="frame-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="ID of the physical frame (relay rack) where pnf is installed." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serialNumber" name="serial-number" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Serial number of the device" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV4Loopback0" name="ipaddress-v4-loopback-0" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV4 Loopback 0 address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV6Loopback0" name="ipaddress-v6-loopback-0" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV6 Loopback 0 address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV4Aim" name="ipaddress-v4-aim" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV4 AIM address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV6Aim" name="ipaddress-v6-aim" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV6 AIM address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipaddressV6Oam" name="ipaddress-v6-oam" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="IPV6 OAM address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="invStatus" name="inv-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="CANOPI's inventory status. Only set with values exactly as defined by CANOPI." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="nfRole" name="nf-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Nf Role is the role performed by this instance in the network." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="pInterfaces" name="p-interfaces" type="inventory.aai.openecomp.org.v9.PInterfaces" /> + <xml-element java-attribute="lagInterfaces" name="lag-interfaces" type="inventory.aai.openecomp.org.v9.LagInterfaces" /> </java-attributes> + <xml-properties> + <xml-property name="description" value="PNF represents a physical network function. typically equipment used in the D1 world." /> + <xml-property name="indexedProps" value="pnf-name,orchestration-status,inv-status" /> + <xml-property name="searchable" value="pnf-name" /> + <xml-property name="uniqueProps" value="pnf-name" /> + <xml-property name="container" value="pnfs" /> + <xml-property name="namespace" value="network" /> + </xml-properties> </java-type> - <java-type name="RelatedToProperty"> - <xml-root-element name="related-to-property" /> + <java-type name="PhysicalLinks"> + <xml-properties> + <xml-property name="description" value="Collection of physical connections, typically between p-interfaces" /> + </xml-properties> + <xml-root-element name="physical-links" /> <java-attributes> - <xml-element java-attribute="propertyKey" name="property-key" type="java.lang.String"> + <xml-element container-type="java.util.ArrayList" java-attribute="physicalLink" name="physical-link" type="inventory.aai.openecomp.org.v9.PhysicalLink" /> + </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + </xml-properties> + </java-type> + + <java-type name="PhysicalLink"> + <xml-root-element name="physical-link" /> + <java-attributes> + <xml-element java-attribute="linkName" name="link-name" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="Key part of a key/value pair" /> + <xml-property name="description" value="e.g., hostnameA_p-connection_nameA_hostnameZ+p_connection-nameZ" /> </xml-properties> </xml-element> - <xml-element java-attribute="propertyValue" name="property-value" type="java.lang.String"> + <xml-element java-attribute="speedValue" name="speed-value" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Value part of a key/value pair" /> + <xml-property name="description" value="Captures the numeric part of the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="speedUnits" name="speed-units" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Captures the units corresponding to the speed" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="circuitId" name="circuit-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Circuit it" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="dualMode" name="dual-mode" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Dual access mode (e.g., primary, secondary" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="To provide information on who manages this circuit. A&AI or 3rd party transport provider" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceProviderName" name="service-provider-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of the service Provider on this link." /> </xml-properties> </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> </java-attributes> + <xml-properties> + <xml-property name="description" value="Collection of physical connections, typically between p-interfaces" /> + <xml-property name="indexedProps" value="circuit-id,link-name" /> + <xml-property name="alternateKeys1" value="circuit-id" /> + <xml-property name="container" value="physical-links" /> + <xml-property name="namespace" value="network" /> + <xml-property name="searchable" value="link-name,circuit-id" /> + </xml-properties> </java-type> - <java-type name="RelationshipData"> - <xml-root-element name="relationship-data" /> + <java-type name="VigServers"> + <xml-root-element name="vig-servers" /> <java-attributes> - <xml-element java-attribute="relationshipKey" name="relationship-key" required="true" type="java.lang.String"> + <xml-element container-type="java.util.ArrayList" java-attribute="vigServer" name="vig-server" type="inventory.aai.openecomp.org.v9.VigServer" /> + </java-attributes> + </java-type> + + <java-type name="VigServer"> + <xml-root-element name="vig-server" /> + <java-attributes> + <xml-element java-attribute="vigAddressType" name="vig-address-type" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="A keyword provided by A&AI to indicate an attribute." /> + <xml-property name="description" value="indicates whether the VIG is for AVPN or INTERNET" /> </xml-properties> </xml-element> - <xml-element java-attribute="relationshipValue" name="relationship-value" required="true" type="java.lang.String"> + <xml-element container-type="java.util.ArrayList" java-attribute="ipaddressV4Vig" name="ipaddress-v4-vig" type="java.lang.String" > <xml-properties> - <xml-property name="description" value="Value of the attribute." /> + <xml-property name="description" value="v4 IP of the vig server" /> + </xml-properties> + </xml-element> + <xml-element container-type="java.util.ArrayList" java-attribute="ipaddressV6Vig" name="ipaddress-v6-vig" type="java.lang.String" > + <xml-properties> + <xml-property name="description" value="v6 IP of the vig server" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> </xml-properties> </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> </java-attributes> + <xml-properties> + <xml-property name="description" value="vig-server contains information about a vig server used for IPSec-configuration. Populated by SDN-C from 1607" /> + <xml-property name="indexedProps" value="vig-address-type" /> + <xml-property name="dependentOn" value="ipsec-configuration" /> + <xml-property name="container" value="vig-servers" /> + </xml-properties> </java-type> - <java-type name="RelationshipData"> - <xml-root-element name="relationship-data" /> + + <java-type name="IpsecConfigurations"> + <xml-root-element name="ipsec-configurations" /> <java-attributes> - <xml-element java-attribute="relationshipKey" name="relationship-key" required="true" type="java.lang.String"> + <xml-element container-type="java.util.ArrayList" java-attribute="ipsecConfiguration" name="ipsec-configuration" type="inventory.aai.openecomp.org.v9.IpsecConfiguration" /> + </java-attributes> + </java-type> + + <java-type name="IpsecConfiguration"> + <xml-root-element name="ipsec-configuration" /> + <java-attributes> + <xml-element java-attribute="ipsecConfigurationId" name="ipsec-configuration-id" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="A keyword provided by A&AI to indicate an attribute." /> + <xml-property name="description" value="UUID of this configuration" /> </xml-properties> </xml-element> - <xml-element java-attribute="relationshipValue" name="relationship-value" required="true" type="java.lang.String"> + <xml-element java-attribute="requestedVigAddressType" name="requested-vig-address-type" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Value of the attribute." /> + <xml-property name="description" value="Indicate the type of VIG server like AVPN, INTERNET, BOTH" /> </xml-properties> </xml-element> + <xml-element java-attribute="requestedEncryptionStrength" name="requested-encryption-strength" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Encryption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="requestedDmzType" name="requested-dmz-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="can offer a shared DMZ or a DMZ specific to a customer" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="sharedDmzNetworkAddress" name="shared-dmz-network-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Network address of shared DMZ" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="requestedCustomerName" name="requested-customer-name" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="If the DMZ is a custom DMZ, this field will indicate the customer information" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ikeVersion" name="ike-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="can be 1 or 2" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ikev1Authentication" name="ikev1-authentication" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Contains values like md5, sha1, sha256, sha384" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ikev1Encryption" name="ikev1-encryption" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Encyption values like 3des-cbc, des-cbc, aes-128-cbc,ĆĀ aes-192-cbc, aes-265-cbc" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ikev1DhGroup" name="ikev1-dh-group" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Diffie-Hellman group like DH-GROUP2, DH-GROUP5, DH-GROUP14" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ikev1AmGroupId" name="ikev1-am-group-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Group name defined in VIG for clients using aggressive mode" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ikev1AmPassword" name="ikev1-am-password" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="pre-shared key for the above group name " /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ikev1SaLifetime" name="ikev1-sa-lifetime" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Lifetime for IKEv1 SA" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipsecAuthentication" name="ipsec-authentication" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="md5, sha1, sha256, sha384" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipsecEncryption" name="ipsec-encryption" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="3des-cbc, des-cbc, aes-128-cbc,ĆĀ aes-192-cbc, aes-265-cbc" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipsecSaLifetime" name="ipsec-sa-lifetime" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Life time for IPSec SA" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipsecPfs" name="ipsec-pfs" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="enable PFS or not" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="xauthUserId" name="xauth-userid" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="user ID for xAuth, sm-user, ,nmteHostName" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="xauthUserPassword" name="xauth-user-password" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Encrypted using the Juniper $9$ algorithm" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="dpdInterval" name="dpd-interval" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The time between DPD probe" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="dpdFrequency" name="dpd-frequency" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Maximum number of DPD before claiming the tunnel is down" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + <xml-element java-attribute="vigServers" name="vig-servers" type="inventory.aai.openecomp.org.v9.VigServers" /> </java-attributes> + <xml-properties> + <xml-property name="description" value="IPSec configuration node will contain various configuration data for the NMTE VNF. This node will have an edge to the generic-vnf (vnf type = TE). Starting 1607, this data will be populated by SDN-C" /> + <xml-property name="indexedProps" value="ipsec-configuration-id" /> + <xml-property name="uniqueProps" value="ipsec-configuration-id" /> + <xml-property name="container" value="ipsec-configurations" /> + <xml-property name="namespace" value="network" /> + </xml-properties> </java-type> - <java-type name="VpnBindings"> - <xml-root-element name="vpn-bindings" /> + + + <java-type name="NotificationEvent"> + <xml-root-element name="notification-event" /> <java-attributes> - <xml-element container-type="java.util.ArrayList" java-attribute="vpnBinding" name="vpn-binding" type="inventory.aai.openecomp.org.v9.VpnBinding" /> + <xml-element java-attribute="cambriaPartition" name="cambria.partition" type="java.lang.String" /> + <xml-element java-attribute="eventHeader" name="event-header" type="inventory.aai.openecomp.org.v9.NotificationEventHeader" /> + <xml-any-element java-attribute="entity" /> + </java-attributes> + </java-type> + <java-type name="NotificationEventHeader"> + <xml-root-element name="notification-event-header" /> + <java-attributes> + <xml-element java-attribute="id" name="id" type="java.lang.String" /> + <xml-element java-attribute="timestamp" name="timestamp" type="java.lang.String" /> + <xml-element java-attribute="sourceName" name="source-name" type="java.lang.String" /> + <xml-element java-attribute="domain" name="domain" type="java.lang.String" /> + <xml-element java-attribute="sequenceNumber" name="sequence-number" type="java.lang.String" /> + <xml-element java-attribute="severity" name="severity" type="java.lang.String" /> + <xml-element java-attribute="eventType" name="event-type" type="java.lang.String" /> + <xml-element java-attribute="version" name="version" type="java.lang.String" /> + <xml-element java-attribute="action" name="action" type="java.lang.String" /> + <xml-element java-attribute="entityType" name="entity-type" type="java.lang.String" /> + <xml-element java-attribute="topEntityType" name="top-entity-type" type="java.lang.String" /> + <xml-element java-attribute="entityLink" name="entity-link" type="java.lang.String" /> + <xml-element java-attribute="status" name="status" type="java.lang.String" /> + </java-attributes> + </java-type> + <java-type name="AaiInternal"> + <xml-root-element name="aai-internal" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="reservedPropNames" name="reserved-prop-names" type="inventory.aai.openecomp.org.v9.ReservedPropNames" /> + <xml-element container-type="java.util.ArrayList" java-attribute="edgePropNames" name="edge-prop-names" type="inventory.aai.openecomp.org.v9.EdgePropNames" /> + </java-attributes> + </java-type> + <java-type name="ReservedPropNames"> + <xml-properties> + <xml-property name="description" value="Internal map to define some reserved properties of a vertex" /> + <xml-property name="uniqueProps" value="aai-unique-key" /> + <xml-property name="indexedProps" value="aai-unique-key,source-of-truth,aai-node-type,aai-uri" /> + </xml-properties> + <xml-root-element name="reserved-prop-names" /> + <java-attributes> + <xml-element java-attribute="lastModSourceOfTruth" name="last-mod-source-of-truth" type="java.lang.String" /> + <xml-element java-attribute="aaiNodeType" name="aai-node-type" type="java.lang.String" /> + <xml-element java-attribute="aaiCreatedTs" name="aai-created-ts" type="java.lang.Long" /> + <xml-element java-attribute="aaiUniqueKey" name="aai-unique-key" type="java.lang.String" /> + <xml-element java-attribute="aaiLastModTs" name="aai-last-mod-ts" type="java.lang.Long" /> + <xml-element java-attribute="sourceOfTruth" name="source-of-truth" type="java.lang.String" /> + <xml-element java-attribute="aaiUri" name="aai-uri" type="java.lang.String" /> + </java-attributes> + </java-type> + <java-type name="EdgePropNames"> + <!-- NOTE that the names of these properties are not consistent and are in mixed case and hyphen case for now --> + <xml-properties> + <xml-property name="description" value="Internal map to define the properties of an edge and interpret the map EdgeRules" /> + <xml-property name="edgeInfo" value="edgeLabel,direction,multiplicityRule,isParent,usesResource,hasDelTarget,SVC-INFRA,SVC-INFRA-REV" /> + </xml-properties> + <xml-root-element name="edge-prop-names" /> + <java-attributes> + <xml-element java-attribute="edgeLabel" name="edgeLabel" type="java.lang.String" /> + <xml-element java-attribute="direction" name="direction" type="java.lang.String" /> + <xml-element java-attribute="multiplicityRule" name="multiplicityRule" type="java.lang.String" /> + <xml-element java-attribute="isParent" name="isParent" type="java.lang.Boolean" /> + <xml-element java-attribute="usesResource" name="usesResource" type="java.lang.Boolean" /> + <xml-element java-attribute="hasDelTarget" name="hasDelTarget" type="java.lang.Boolean" /> + <xml-element java-attribute="SVC-INFRA" name="SVC-INFRA" type="java.lang.Boolean" /> + <xml-element java-attribute="SVC-INFRA-REV" name="SVC-INFRA-REV" type="java.lang.Boolean" /> </java-attributes> </java-type> - <java-type name="VpnBinding"> - <xml-root-element name="vpn-binding" /> + <java-type name="Models"> + <xml-properties> + <xml-property name="description" value="Collection of subgraph definitions provided by ASDC to describe the inventory assets and their connections related to ASDC models" /> + </xml-properties> + <xml-root-element name="models" /> <java-attributes> - <xml-element java-attribute="vpnId" name="vpn-id" required="true" type="java.lang.String" xml-key="true"> + <xml-element container-type="java.util.ArrayList" java-attribute="model" name="model" type="inventory.aai.openecomp.org.v9.Model" /> + </java-attributes> + </java-type> + + <java-type name="Model"> + <xml-root-element name="model" /> + <xml-properties> + <xml-property name="description" value="Subgraph definition provided by ASDC to describe an inventory asset and its connections related to ASDC models, independent of version" /> + <xml-property name="nameProps" value="model-type" /> + <xml-property name="indexedProps" value="model-invariant-id,model-type" /> + <xml-property name="uniqueProps" value="model-invariant-id" /> + <xml-property name="container" value="models" /> + <xml-property name="namespace" value="service-design-and-creation" /> + </xml-properties> + <java-attributes> + <xml-element java-attribute="modelInvariantId" name="model-invariant-id" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="VPN ID, globally unique within A&AI" /> + <xml-property name="description" value="Unique identifier corresponding to the main definition of a model in ASDC" /> </xml-properties> </xml-element> - <xml-element java-attribute="vpnName" name="vpn-name" required="true" type="java.lang.String"> + <xml-element java-attribute="modelType" name="model-type" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="VPN Name" /> + <xml-property name="description" value="Type of the model, e.g., service, resource, widget, etc." /> </xml-properties> </xml-element> - <xml-element java-attribute="globalRouteTarget" name="global-route-target" required="true" type="java.lang.String"> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Number used to identify a VPN, globally unique in the network" /> - <xml-property name="dataLink" value="./route-targets/route-target/{global-route-target}/{route-target-role}" /> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> </xml-properties> </xml-element> - <xml-element java-attribute="vpnPlatform" name="vpn-platform" type="java.lang.String"> + <xml-element java-attribute="modelVers" name="model-vers" type="inventory.aai.openecomp.org.v9.ModelVers" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + + <java-type name="ModelVers"> + <xml-root-element name="model-vers" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="modelVer" name="model-ver" type="inventory.aai.openecomp.org.v9.ModelVer" /> + </java-attributes> + </java-type> + + <java-type name="ModelVer"> + <xml-root-element name="model-ver" /> + <xml-properties> + <xml-property name="description" value="Subgraph definition provided by ASDC to describe a specific version of an inventory asset and its connections related to ASDC models" /> + <xml-property name="nameProps" value="model-name" /> + <xml-property name="indexedProps" value="model-version-id,model-name,model-version" /> + <xml-property name="uniqueProps" value="model-version-id" /> + <xml-property name="container" value="model-vers" /> + </xml-properties> + <java-attributes> + <xml-element java-attribute="modelVersionId" name="model-version-id" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="the platform associated with the VPN example AVPN, Mobility" /> + <xml-property name="description" value="Unique identifier corresponding to one version of a model in ASDC" /> </xml-properties> </xml-element> - <xml-element java-attribute="vpnType" name="vpn-type" type="java.lang.String"> + <xml-element java-attribute="modelName" name="model-name" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Type of the vpn, should be taken from enumerated/valid values" /> + <xml-property name="description" value="Name of the model, which can change from version to version." /> </xml-properties> </xml-element> - <xml-element java-attribute="routeDistinguisher" name="route-distinguisher" type="java.lang.String"> + <xml-element java-attribute="modelVersion" name="model-version" required="true" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Used to distinguish the distinct VPN routes of separate customers who connect to the provider in an MPLS network." /> + <xml-property name="description" value="Version" /> </xml-properties> </xml-element> - <xml-element java-attribute="routeTargetRole" name="route-target-role" type="java.lang.String"> + <xml-element java-attribute="modelDescription" name="model-description" type="java.lang.String"> <xml-properties> - <xml-property name="description" value="Role assigned to this route target" /> - <xml-property name="dataLink" value="./route-targets/route-target/{global-route-target}/{route-target-role}" /> + <xml-property name="description" value="Description" /> </xml-properties> </xml-element> <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> @@ -576,21 +4597,1119 @@ <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> </xml-properties> </xml-element> - <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList"> + <xml-element java-attribute="modelElements" name="model-elements" type="inventory.aai.openecomp.org.v9.ModelElements" /> + <xml-element java-attribute="metadata" name="metadata" type="inventory.aai.openecomp.org.v9.Metadata" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + <java-type name="ModelElements"> + <xml-root-element name="model-elements" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="modelElement" name="model-element" type="inventory.aai.openecomp.org.v9.ModelElement" /> + </java-attributes> + </java-type> + + <java-type name="ModelElement"> + <xml-properties> + <xml-property name="description" value="Defines how other models combine to make up a higher-level model." /> + <xml-property name="uniqueProps" value="model-element-uuid" /> + <xml-property name="indexedProps" value="model-element-uuid" /> + <xml-property name="allowDirectRead" value="true" /> + <xml-property name="allowDirectWrite" value="false" /> + <xml-property name="container" value="model-elements" /> + </xml-properties> + <xml-root-element name="model-element" /> + <java-attributes> + <xml-element java-attribute="modelElementUuid" name="model-element-uuid" required="true" type="java.lang.String" xml-key="true"> <xml-properties> - <xml-property name="description" value="l3-networks relate to vpn-bindings" /> + <xml-property name="autoGenerateUuid" value="true" /> </xml-properties> </xml-element> + <xml-element java-attribute="newDataDelFlag" name="new-data-del-flag" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indicates whether this element was created as part of instantiation from this model" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="cardinality" name="cardinality" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="How many of this type of element are required/allowed" /> + </xml-properties> + </xml-element> + <xml-element container-type="java.util.ArrayList" java-attribute="linkagePoints" name="linkage-points" type="java.lang.String" > + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelElements" name="model-elements" type="inventory.aai.openecomp.org.v9.ModelElements"> + <xml-properties> + <xml-property name="description" value="Defines how other models combine to make up a higher-level model" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelConstraints" name="model-constraints" type="inventory.aai.openecomp.org.v9.ModelConstraints"> + <xml-properties> + <xml-property name="description" value="Describes new constraints on this model element that are not part of that model's definition" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + <java-type name="ModelConstraints"> + <xml-root-element name="model-constraints" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="modelConstraint" name="model-constraint" type="inventory.aai.openecomp.org.v9.ModelConstraint" /> </java-attributes> + </java-type> + + <java-type name="ModelConstraint"> <xml-properties> - <xml-property name="description" value="VPN binding" /> - <xml-property name="nameProps" value="vpn-name,vpn-type" /> - <xml-property name="indexedProps" value="vpn-name,vpn-id,global-route-target,vpn-type" /> - <xml-property name="searchable" value="vpn-id,vpn-name" /> - <xml-property name="uniqueProps" value="vpn-id" /> - <xml-property name="container" value="vpn-bindings" /> + <xml-property name="description" value="This is how we would capture constraints defining allowed sets of elements." /> + <xml-property name="uniqueProps" value="model-constraint-uuid" /> + <xml-property name="indexedProps" value="model-constraint-uuid" /> + <xml-property name="allowDirectRead" value="true" /> + <xml-property name="allowDirectWrite" value="false" /> + <xml-property name="container" value="model-constraints" /> + </xml-properties> + <xml-root-element name="model-constraint" /> + <java-attributes> + <xml-element java-attribute="modelConstraintUuid" name="model-constraint-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="autoGenerateUuid" value="true" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="constrainedElementSetUuidToReplace" name="constrained-element-set-uuid-to-replace" required="true" type="java.lang.String" /> + <xml-element java-attribute="constrainedElementSets" name="constrained-element-sets" type="inventory.aai.openecomp.org.v9.ConstrainedElementSets" /> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + </java-attributes> + </java-type> + + <java-type name="ConstrainedElementSets"> + <xml-root-element name="constrained-element-sets" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="constrainedElementSet" name="constrained-element-set" type="inventory.aai.openecomp.org.v9.ConstrainedElementSet" /> + </java-attributes> + </java-type> + + <java-type name="ConstrainedElementSet"> + <xml-properties> + <xml-property name="description" value="This is how we would capture constraints defining allowed sets of elements." /> + <xml-property name="uniqueProps" value="constrained-element-set-uuid" /> + <xml-property name="indexedProps" value="constrained-element-set-uuid" /> + <xml-property name="allowDirectRead" value="true" /> + <xml-property name="allowDirectWrite" value="false" /> + <xml-property name="container" value="constrained-element-sets" /> + </xml-properties> + <xml-root-element name="constrained-element-set" /> + <java-attributes> + <xml-element java-attribute="constrainedElementSetUuid" name="constrained-element-set-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="autoGenerateUuid" value="true" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="constraintType" name="constraint-type" required="true" type="java.lang.String" /> + <xml-element java-attribute="checkType" name="check-type" required="true" type="java.lang.String" /> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" /> + <xml-element java-attribute="elementChoiceSets" name="element-choice-sets" type="inventory.aai.openecomp.org.v9.ElementChoiceSets" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + <java-type name="ElementChoiceSets"> + <xml-root-element name="element-choice-sets" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="elementChoiceSet" name="element-choice-set" type="inventory.aai.openecomp.org.v9.ElementChoiceSet" /> + </java-attributes> + </java-type> + + <java-type name="ElementChoiceSet"> + <xml-properties> + <xml-property name="description" value="This is how we would capture constraints defining allowed sets of elements." /> + <xml-property name="uniqueProps" value="element-choice-set-uuid" /> + <xml-property name="indexedProps" value="element-choice-set-uuid" /> + <xml-property name="allowDirectRead" value="true" /> + <xml-property name="allowDirectWrite" value="false" /> + <xml-property name="container" value="element-choice-sets" /> + </xml-properties> + <xml-root-element name="element-choice-set" /> + <java-attributes> + <xml-element java-attribute="elementChoiceSetUuid" name="element-choice-set-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="autoGenerateUuid" value="true" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="elementChoiceSetName" name="element-choice-set-name" required="true" type="java.lang.String" /> + <xml-element java-attribute="cardinality" name="cardinality" type="java.lang.String" /> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" /> + <xml-element java-attribute="modelElements" name="model-elements" type="inventory.aai.openecomp.org.v9.ModelElements" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + <java-type name="NamedQueries"> + <xml-root-element name="named-queries" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="namedQuery" name="named-query" type="inventory.aai.openecomp.org.v9.NamedQuery" /> + </java-attributes> + </java-type> + + <java-type name="NamedQuery"> + <xml-properties> + <xml-property name="description" value="TBD" /> + <xml-property name="nameProps" value="named-query-name" /> + <xml-property name="uniqueProps" value="named-query-uuid" /> + <xml-property name="indexedProps" value="named-query-uuid,named-query-name" /> + <xml-property name="container" value="named-queries" /> + <xml-property name="namespace" value="service-design-and-creation" /> + </xml-properties> + <xml-root-element name="named-query" /> + <java-attributes> + <xml-element java-attribute="namedQueryUuid" name="named-query-uuid" required="true" type="java.lang.String" xml-key="true" /> + <xml-element java-attribute="namedQueryName" name="named-query-name" required="true" type="java.lang.String" /> + <xml-element java-attribute="namedQueryVersion" name="named-query-version" required="true" type="java.lang.String" /> + <xml-element container-type="java.util.ArrayList" java-attribute="requiredInputParams" name="required-input-param" type="java.lang.String" > + <xml-element-wrapper name="required-input-params" /> + </xml-element> + <xml-element java-attribute="description" name="description" type="java.lang.String" /> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" /> + <xml-element java-attribute="namedQueryElements" name="named-query-elements" type="inventory.aai.openecomp.org.v9.NamedQueryElements" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + <java-type name="NamedQueryElements"> + <xml-root-element name="named-query-elements" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="namedQueryElement" name="named-query-element" type="inventory.aai.openecomp.org.v9.NamedQueryElement" /> + </java-attributes> + </java-type> + + <java-type name="NamedQueryElement"> + <xml-properties> + <xml-property name="description" value="TBD" /> + <xml-property name="uniqueProps" value="named-query-element-uuid" /> + <xml-property name="indexedProps" value="named-query-element-uuid" /> + <xml-property name="allowDirectRead" value="true" /> + <xml-property name="allowDirectWrite" value="false" /> + <xml-property name="container" value="named-query-elements" /> + </xml-properties> + <xml-root-element name="named-query-element" /> + <java-attributes> + <xml-element java-attribute="namedQueryElementUuid" name="named-query-element-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="autoGenerateUuid" value="true" /> + </xml-properties> + </xml-element> + <xml-element container-type="java.util.ArrayList" java-attribute="propertyCollectList" name="property-collect-list" type="java.lang.String" /> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" /> + <xml-element java-attribute="propertyLimitDesc" name="property-limit-desc" type="java.lang.String" /> + <xml-element java-attribute="doNotOutput" name="do-not-output" type="java.lang.String" /> + <xml-element java-attribute="namedQueryElements" name="named-query-elements" type="inventory.aai.openecomp.org.v9.NamedQueryElements" /> + <xml-element java-attribute="relatedLookups" name="related-lookups" type="inventory.aai.openecomp.org.v9.RelatedLookups" /> + <xml-element java-attribute="propertyConstraints" name="property-constraints" type="inventory.aai.openecomp.org.v9.PropertyConstraints" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + <java-type name="RelatedLookups"> + <xml-root-element name="related-lookups" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="relatedLookup" name="related-lookup" type="inventory.aai.openecomp.org.v9.RelatedLookup" /> + </java-attributes> + </java-type> + + <java-type name="RelatedLookup"> + <xml-properties> + <xml-property name="description" value="TBD" /> + <xml-property name="uniqueProps" value="related-lookup-uuid" /> + <xml-property name="indexedProps" value="related-lookup-uuid" /> + <xml-property name="allowDirectRead" value="true" /> + <xml-property name="allowDirectWrite" value="false" /> + <xml-property name="container" value="related-lookups" /> + </xml-properties> + <xml-root-element name="related-lookup" /> + <java-attributes> + <xml-element java-attribute="relatedLookupUuid" name="related-lookup-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="autoGenerateUuid" value="true" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="sourceNodeType" name="source-node-type" required="true" type="java.lang.String" /> + <xml-element java-attribute="sourceNodeProperty" name="source-node-property" required="true" type="java.lang.String" /> + <xml-element java-attribute="targetNodeType" name="target-node-type" required="true" type="java.lang.String" /> + <xml-element java-attribute="targetNodeProperty" name="target-node-property" required="true" type="java.lang.String" /> + <xml-element container-type="java.util.ArrayList" java-attribute="propertyCollectList" name="property-collect-list" type="java.lang.String" /> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + <java-type name="PropertyConstraints"> + <xml-root-element name="property-constraints" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="propertyConstraint" name="property-constraint" type="inventory.aai.openecomp.org.v9.PropertyConstraint" /> + </java-attributes> + </java-type> + + <java-type name="PropertyConstraint"> + <xml-properties> + <xml-property name="description" value="TBD" /> + <xml-property name="uniqueProps" value="property-constraint-uuid" /> + <xml-property name="indexedProps" value="property-constraint-uuid" /> + <xml-property name="allowDirectRead" value="true" /> + <xml-property name="allowDirectWrite" value="false" /> + <xml-property name="container" value="property-constraints" /> + </xml-properties> + <xml-root-element name="property-constraint" /> + <java-attributes> + <xml-element java-attribute="propertyConstraintUuid" name="property-constraint-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="autoGenerateUuid" value="true" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="constraintType" name="constraint-type" required="true" type="java.lang.String" /> + <xml-element java-attribute="propertyName" name="property-name" required="true" type="java.lang.String" /> + <xml-element java-attribute="propertyValue" name="property-value" required="true" type="java.lang.String" /> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="ModelAndNamedQuerySearch"> + <xml-properties> + <xml-property name="description" value="ModelAndNamedQuerySearch holds query-parameters and instance-properties for performing a named-query or model query" /> + </xml-properties> + <xml-root-element name="model-and-named-query-search" /> + <java-attributes> + <xml-element java-attribute="queryParameters" name="query-parameters" type="inventory.aai.openecomp.org.v9.QueryParameters" /> + <xml-element java-attribute="instanceFilters" name="instance-filters" type="inventory.aai.openecomp.org.v9.InstanceFilters" /> + <xml-element java-attribute="secondaryFilts" name="secondary-filts" type="inventory.aai.openecomp.org.v9.SecondaryFilts" /> + <xml-element java-attribute="topNodeType" name="top-node-type" type="java.lang.String" /> + <xml-element java-attribute="secondaryFilterCutPoint" name="secondary-filter-cut-point" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="QueryParameters"> + <xml-properties> + <xml-property name="description" value="QueryParameters for performing a named-query or model query" /> + </xml-properties> + <xml-root-element name="query-parameters" /> + <java-attributes> + <xml-element java-attribute="namedQuery" name="named-query" type="inventory.aai.openecomp.org.v9.NamedQuery" /> + <xml-element java-attribute="model" name="model" type="inventory.aai.openecomp.org.v9.OverloadedModel" /> + </java-attributes> + </java-type> + + <java-type name="OverloadedModel"> + <xml-root-element name="overloaded-model" /> + <xml-properties> + <xml-property name="description" value="Allows for legacy POST of old-style and new-style models" /> + </xml-properties> + <java-attributes> + <xml-element java-attribute="modelInvariantId" name="model-invariant-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique identifier corresponding to the main definition of a model in ASDC" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelNameVersionId" name="model-name-version-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique identifier corresponding to one version of a model in ASDC" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelType" name="model-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Type of the model, e.g., service, resource, widget, etc." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelName" name="model-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of the model, which can change from version to version." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelId" name="model-id" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Invariant unique ID which does not change from version to version" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelVersion" name="model-version" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Version" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelDescription" name="model-description" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Description" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelVers" name="model-vers" type="inventory.aai.openecomp.org.v9.ModelVers" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + </java-type> + + <java-type name="InstanceFilters"> + <xml-properties> + <xml-property name="description" value="InstanceFilters for performing a named-query or model query" /> + </xml-properties> + <xml-root-element name="instance-filters" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="instanceFilter" name="instance-filter" type="inventory.aai.openecomp.org.v9.InstanceFilter" /> + </java-attributes> + </java-type> + + <java-type name="InstanceFilter"> + <xml-properties> + <xml-property name="description" value="InstanceFilter for performing a named-query or model query" /> + <xml-property name="container" value="instance-filters" /> + </xml-properties> + <xml-root-element name="instance-filter" /> + <java-attributes> + <xml-any-element container-type="java.util.ArrayList" java-attribute="any" lax="true" name="any" /> + </java-attributes> + </java-type> + + <java-type name="SecondaryFilts"> + <xml-properties> + <xml-property name="description" value="SecondaryFilts for performing a named-query or model query" /> + </xml-properties> + <xml-root-element name="secondary-filts" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="secondaryFilt" name="secondary-filt" type="inventory.aai.openecomp.org.v9.SecondaryFilt" /> + </java-attributes> + </java-type> + + <java-type name="SecondaryFilt"> + <xml-properties> + <xml-property name="description" value="SecondaryFilt for performing a named-query or model query" /> + </xml-properties> + <xml-root-element name="secondary-filt" /> + <java-attributes> + <xml-any-element container-type="java.util.ArrayList" java-attribute="any" lax="true" name="any" /> + </java-attributes> + </java-type> + + <java-type name="Properties"> + <xml-properties> + <xml-property name="description" value="Property holder for query properties or instance properties" /> + </xml-properties> + <xml-root-element name="properties" /> + <java-attributes> + <xml-element java-attribute="propertyName" name="property-name" type="java.lang.String" /> + <xml-element java-attribute="propertyValue" name="property-value" type="java.lang.String" /> + </java-attributes> + </java-type> + + <java-type name="ResponseList"> + <xml-properties> + <xml-property name="description" value="Response container for the results of a named-query or model query" /> + </xml-properties> + <xml-root-element name="response-list" /> + <java-attributes> + <xml-element java-attribute="inventoryResponseItems" name="inventory-response-items" type="inventory.aai.openecomp.org.v9.InventoryResponseItems" /> + </java-attributes> + </java-type> + + <java-type name="InventoryResponseItems"> + <xml-properties> + <xml-property name="description" value="Container for inventory items in response list" /> + <xml-property name="container" value="response-list" /> + </xml-properties> + <xml-root-element name="inventory-response-items" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="inventoryResponseItem" name="inventory-response-item" type="inventory.aai.openecomp.org.v9.InventoryResponseItem" /> + </java-attributes> + </java-type> + + <java-type name="InventoryResponseItem"> + <xml-properties> + <xml-property name="description" value="Inventory item for response list" /> + <xml-property name="container" value="inventory-response-items" /> + </xml-properties> + <xml-root-element name="inventory-response-item" /> + <java-attributes> + <xml-element java-attribute="modelName" name="model-name" type="java.lang.String" /> + <xml-any-element java-attribute="item" /> + <xml-element java-attribute="extraProperties" name="extra-properties" type="inventory.aai.openecomp.org.v9.ExtraProperties" /> + <xml-element java-attribute="inventoryResponseItems" name="inventory-response-items" type="inventory.aai.openecomp.org.v9.InventoryResponseItems" /> + </java-attributes> + </java-type> + + <java-type name="ExtraProperties"> + <xml-properties> + <xml-property name="description" value="Extra properties for inventory item for response list" /> + </xml-properties> + <xml-root-element name="extra-properties" /> + <java-attributes> + <xml-any-element container-type="java.util.ArrayList" java-attribute="extraProperty" name="extra-property" type="inventory.aai.openecomp.org.v9.ExtraProperty" /> + </java-attributes> + </java-type> + + <java-type name="ExtraProperty"> + <xml-root-element name="extra-property" /> + <java-attributes> + <xml-element java-attribute="propertyName" name="property-name" type="java.lang.String" /> + <xml-any-element java-attribute="propertyValue" lax="true" name="property-value" /> + </java-attributes> + </java-type> + + <java-type name="RouteTableReferences"> + <xml-properties> + <xml-property name="description" value="Collection of openstack route table references" /> + </xml-properties> + <xml-root-element name="route-table-references" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="routeTableReference" name="route-table-reference" type="inventory.aai.openecomp.org.v9.RouteTableReference" /> + </java-attributes> + </java-type> + + <java-type name="RouteTableReference"> + <xml-root-element name="route-table-reference" /> + <java-attributes> + <xml-element java-attribute="routeTableReferenceId" name="route-table-reference-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Route Table Reference id, UUID assigned to this instance." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="routeTableReferenceFqdn" name="route-table-reference-fqdn" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="FQDN entry in the route table." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Concurrency value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + + <xml-properties> + <xml-property name="description" value="Openstack route table reference." /> + <xml-property name="nameProps" value="route-table-reference-fqdn" /> + <xml-property name="uniqueProps" value="route-table-reference-id" /> + <xml-property name="indexedProps" value="route-table-reference-id,route-table-reference-fqdn" /> + <xml-property name="container" value="route-table-references" /> <xml-property name="namespace" value="network" /> </xml-properties> </java-type> + + <java-type name="InstanceGroups"> + <xml-properties> + <xml-property name="description" value="Collection of openstack route table references" /> + </xml-properties> + <xml-root-element name="instance-groups" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="instanceGroup" name="instance-group" type="inventory.aai.openecomp.org.v9.InstanceGroup" /> + </java-attributes> + </java-type> + + <java-type name="InstanceGroup"> + <xml-root-element name="instance-group" /> + <java-attributes> + <xml-element java-attribute="id" name="id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Instance Group ID, UUID assigned to this instance." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="description" name="description" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Descriptive text to help identify the usage of this instance-group" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="type" name="type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Only valid value today is lower case ha for high availability" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="subType" name="sub-type" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Valid values for ha type are [geo-activeactive, geo-activestandby, local-activeactive, local-activestandby]" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Concurrency value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + + <xml-properties> + <xml-property name="description" value="General mechanism for grouping instances" /> + <xml-property name="nameProps" value="description" /> + <xml-property name="uniqueProps" value="id" /> + <xml-property name="indexedProps" value="id,description,type,sub-type" /> + <xml-property name="container" value="instance-groups" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + + + <java-type name="SegmentationAssignments"> + <xml-properties> + <xml-property name="description" value="Collection of openstack segmentation assignments" /> + </xml-properties> + <xml-root-element name="segmentation-assignments" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="segmentationAssignment" name="segmentation-assignment" type="inventory.aai.openecomp.org.v9.SegmentationAssignment" /> + </java-attributes> + </java-type> + + <java-type name="SegmentationAssignment"> + <xml-root-element name="segmentation-assignment" /> + <java-attributes> + <xml-element java-attribute="segmentationId" name="segmentation-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Route Table Reference id, UUID assigned to this instance." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Concurrency value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Openstack segmentation assignment." /> + <xml-property name="indexedProps" value="segmentation-id" /> + <xml-property name="dependentOn" value="l3-network" /> + <xml-property name="container" value="segmentation-assignments" /> + </xml-properties> + </java-type> + + <java-type name="AllottedResources"> + <xml-properties> + <xml-property name="description" value="This object is used to store slices of services being offered" /> + </xml-properties> + <xml-root-element name="allotted-resources" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="allottedResource" name="allotted-resource" type="inventory.aai.openecomp.org.v9.AllottedResource" /> + </java-attributes> + </java-type> + + <java-type name="AllottedResource"> + <xml-root-element name="allotted-resource" /> + <java-attributes> + <xml-element java-attribute="id" name="id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Allotted Resource id UUID assigned to this instance." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="description" name="description" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The descriptive information assigned to this allotted resource instance" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="selflink" name="selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Link back to more information in the controller" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelId" name="persona-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model id for this resource or service model." /> + <xml-property name="dbAlias" value="model-invariant-id-local" /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="deployment" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="internal" /> + <xml-property name="dbAlias" value="model-version-id-local" /> + <xml-property name="dataCopy" value="service-design-and-creation/models/model/{persona-model-id}/model-vers?model-version={persona-model-version}#model-version-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelCustomizationId" name="persona-model-customization-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="captures the id of all the configuration used to customize the resource for the service." /> + <xml-property name="dbAlias" value="model-customization-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Concurrency value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="tunnelXconnects" name="tunnel-xconnects" type="inventory.aai.openecomp.org.v9.TunnelXconnects" /> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + + <xml-properties> + <xml-property name="description" value="Represents a slice or partial piece of a resource that gets separately allotted" /> + <xml-property name="nameProps" value="description" /> + <xml-property name="uniqueProps" value="id" /> + <xml-property name="indexedProps" value="id,persona-model-id,persona-model-version" /> + <xml-property name="dependentOn" value="service-instance" /> + <xml-property name="container" value="allotted-resources" /> + <!-- <xml-property name="namespace" value="network" /> --> + </xml-properties> + </java-type> + + <java-type name="TunnelXconnects"> + <xml-properties> + <xml-property name="description" value="This object is used to store the specific tunnel cross connect aspects of an allotted resource" /> + </xml-properties> + <xml-root-element name="tunnel-xconnects" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="tunnelXconnect" name="tunnel-xconnect" type="inventory.aai.openecomp.org.v9.TunnelXconnect" /> + </java-attributes> + </java-type> + + <java-type name="TunnelXconnect"> + <xml-root-element name="tunnel-xconnect" /> + <java-attributes> + <xml-element java-attribute="id" name="id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Allotted Resource id UUID assigned to this instance." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthUpWan1" name="bandwidth-up-wan1" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The WAN uplink bandwidth for WAN1" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthDownWan1" name="bandwidth-down-wan1" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The WAN downlink bandwidth for WAN1" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthUpWan2" name="bandwidth-up-wan2" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The WAN uplink bandwidth for WAN2" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="bandwidthDownWan2" name="bandwidth-down-wan2" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="The WAN downlink bandwidth for WAN2" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Concurrency value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + + <xml-properties> + <xml-property name="description" value="Represents the specifics of a tunnel cross connect piece of a resource that gets separately allotted" /> + <xml-property name="uniqueProps" value="id" /> + <xml-property name="indexedProps" value="id" /> + <xml-property name="dependentOn" value="allotted-resource" /> + <xml-property name="container" value="tunnel-xconnects" /> + <!-- <xml-property name="namespace" value="network" /> --> + </xml-properties> + </java-type> + + <java-type name="Entitlements"> + <xml-properties> + <xml-property name="description" value="Entitlements, keyed by group-uuid and resource-uuid, related to license management" /> + </xml-properties> + <xml-root-element name="entitlements" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="entitlement" name="entitlement" type="inventory.aai.openecomp.org.v9.Entitlement" /> + </java-attributes> + </java-type> + + <java-type name="Entitlement"> + <xml-root-element name="entitlement" /> + <java-attributes> + <xml-element java-attribute="groupUuid" name="group-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID for the entitlement group the resource comes from, should be uuid." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceUuid" name="resource-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID of an entitlement resource. " /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Concurrency value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Metadata for entitlement group." /> + <xml-property name="indexedProps" value="group-uuid,resource-uuid" /> + <xml-property name="dependentOn" value="generic-vnf,vce,vpe" /> + <xml-property name="container" value="entitlements" /> + </xml-properties> + </java-type> + + + <java-type name="Licenses"> + <xml-properties> + <xml-property name="description" value="Licenses to be allocated across resources, keyed by group-uuid and resource-uuid, related to license management" /> + </xml-properties> + <xml-root-element name="licenses" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="license" name="license" type="inventory.aai.openecomp.org.v9.License" /> + </java-attributes> + </java-type> + + <java-type name="License"> + <xml-root-element name="license" /> + <java-attributes> + <xml-element java-attribute="groupUuid" name="group-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID for the license group the resource belongs to, should be uuid." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceUuid" name="resource-uuid" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique ID of a license resource. " /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Concurrency value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Metadata for license group." /> + <xml-property name="indexedProps" value="group-uuid,resource-uuid" /> + <xml-property name="dependentOn" value="generic-vnf,vce,vpe" /> + <xml-property name="container" value="licenses" /> + </xml-properties> + </java-type> + + <java-type name="Vnf"> + <xml-root-element name="vnf"/> + <java-attributes> + <xml-element java-attribute="vnfId" name="vnf-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of VNF. This is unique across the graph." /> + </xml-properties> + </xml-element> + </java-attributes> + <xml-properties> + <xml-property name="description" value="Abstract vnf class" /> + <xml-property name="indexedProps" value="vnf-id" /> + <xml-property name="uniqueProps" value="vnf-id" /> + <xml-property name="inheritors" value="vce,vpe,generic-vnf" /> + <xml-property name="abstract" value="true" /> + </xml-properties> + </java-type> + + <java-type name="Zones"> + <xml-properties> + <xml-property name="description" value="Collection of zones" /> + </xml-properties> + <xml-root-element name="zones" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="zone" name="zone" type="inventory.aai.openecomp.org.v9.Zone" /> + </java-attributes> + </java-type> + + <java-type name="Zone"> + <xml-root-element name="zone" /> + <java-attributes> + <xml-element java-attribute="zoneId" name="zone-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Code assigned by AIC to the zone" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="zoneName" name="zone-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="English name associated with the zone" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="designType" name="design-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Design of zone [Medium/Largeā¦]" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="zoneContext" name="zone-context" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Context of zone [production/test]" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="status" name="status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Status of a zone." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Concurrency value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="A zone is a grouping of assets in a location homing to the same connections into the CBB" /> + <xml-property name="nameProps" value="zone-name" /> + <xml-property name="indexedProps" value="zone-id,design-type,zone-context" /> + <xml-property name="uniqueProps" value="zone-id" /> + <xml-property name="container" value="zones" /> + <xml-property name="namespace" value="network" /> + </xml-properties> + </java-type> + <java-type name="TestObjects"> + <xml-root-element name="test-objects" /> + <java-attributes> + <xml-element container-type="java.util.ArrayList" java-attribute="testObject" name="test-object" type="inventory.aai.openecomp.org.v9.TestObject" /> + </java-attributes> + <xml-properties> + <xml-property name="maximumDepth" value="0" /> + <xml-property name="description" value="Collection of VNFs" /> + </xml-properties> + </java-type> + + <java-type name="TestObject"> + <xml-root-element name="test-object" /> + <java-attributes> + <xml-element java-attribute="vnfId" name="vnf-id" required="true" type="java.lang.String" xml-key="true"> + <xml-properties> + <xml-property name="description" value="Unique id of VNF. This is unique across the graph." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfName" name="vnf-name" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Name of VNF." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfName2" name="vnf-name2" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Alternate name of VNF." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vnfType" name="vnf-type" required="true" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="serviceId" name="service-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Unique identifier of service, does not necessarily map to ASDC service models. SOON TO BE DEPRECATED" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="regionalResourceZone" name="regional-resource-zone" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Regional way of organizing pservers, source of truth should define values" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="provStatus" name="prov-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Trigger for operational monitoring of this resource by Service Assurance systems." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="operationalState" name="operational-state" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Indicator for whether the resource is considered operational. Valid values are in-service-path and out-of-service-path." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="licenseKey" name="license-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="OBSOLETE - do not use" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="equipmentRole" name="equipment-role" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Client should send valid enumerated value" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="orchestrationStatus" name="orchestration-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Orchestration status of this VNF, used by MSO." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="heatStackId" name="heat-stack-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Heat stack id corresponding to this instance, managed by MSO" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="msoCatalogKey" name="mso-catalog-key" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Corresponds to the SDN-C catalog id used to configure this VCE" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="managementOption" name="management-option" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="identifier of managed by company or customer" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4OamAddress" name="ipv4-oam-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Address tail-f uses to configure test-object, also used for troubleshooting and is IP used for traps generated by test-object." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="ipv4Loopback0Address" name="ipv4-loopback0-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="v4 Loopback0 address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="nmLanV6Address" name="nm-lan-v6-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="v6 Loopback address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="managementV6Address" name="management-v6-address" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="v6 management address" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vcpu" name="vcpu" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="number of vcpus ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only in some usecases" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vcpuUnits" name="vcpu-units" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="units associated with vcpu, used for VNFs with no vservers/flavors, to be used only in some usecases" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vmemory" name="vmemory" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="number of GB of memory ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only in some usecases" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vmemoryUnits" name="vmemory-units" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="units associated with vmemory, used for VNFs with no vservers/flavors, to be used only in some usecases" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vdisk" name="vdisk" type="java.lang.Long"> + <xml-properties> + <xml-property name="description" value="number of vdisks ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only in some usecases" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="vdiskUnits" name="vdisk-units" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="units associated with vdisk, used for VNFs with no vservers/flavors, to be used only in some usecases" /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="inMaint" name="in-maint" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs." /> + </xml-properties> + </xml-element> + <xml-element default-value="false" required="true" java-attribute="isClosedLoopDisabled" name="is-closed-loop-disabled" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="defaultValue" value="false"/> + <xml-property name="description" value="used to indicate whether closed loop function is enabled on this node" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="resourceVersion" name="resource-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Used for optimistic concurrency. Must be empty on create, valid on update and delete." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="summaryStatus" name="summary-status" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="details regarding the test-object operation, PLEASE DISCONTINUE USE OF THIS FIELD." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="encryptedAccessFlag" name="encrypted-access-flag" type="java.lang.Boolean"> + <xml-properties> + <xml-property name="description" value="indicates whether access uses SSH" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="entitlementAssignmentGroupUuid" name="entitlement-assignment-group-uuid" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="UUID of the Entitlement group used for licensing VNFs, OBSOLETE - See child relationships." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="entitlementResourceUuid" name="entitlement-resource-uuid" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="UUID of the specific entitlement resource. OBSOLETE - See child relationships." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="licenseAssignmentGroupUuid" name="license-assignment-group-uuid" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="UUID of the license assignment group. OBSOLETE - See child relationships." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="licenseKeyUuid" name="license-key-uuid" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="UUID of the actual license resource. OBSOLETE - See child relationships." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelId" name="persona-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model id for this resource or service model." /> + <xml-property name="dbAlias" value="model-invariant-id-local" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelVersion" name="persona-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="modelVersionId" name="model-version-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC model version for this resource or service model." /> + <xml-property name="visibility" value="internal" /> + <xml-property name="dbAlias" value="model-version-id-local" /> + <xml-property name="dataCopy" value="service-design-and-creation/models/model/{persona-model-id}/model-vers?model-version={persona-model-version}#model-version-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="personaModelCustomizationId" name="persona-model-customization-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="captures the id of all the configuration used to customize the resource for the service." /> + <xml-property name="dbAlias" value="model-customization-id" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelId" name="widget-model-id" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary widget model. This maps directly to the A&AI widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="widgetModelVersion" name="widget-model-version" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="asNumber" name="as-number" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="as-number of the VNF" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="regionalResourceSubzone" name="regional-resource-subzone" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="represents sub zone of the rr plane" /> + </xml-properties> + </xml-element> + <xml-element java-attribute="selflink" name="selflink" type="java.lang.String"> + <xml-properties> + <xml-property name="description" value="Path to the controller object." /> + </xml-properties> + </xml-element> + <xml-element java-attribute="relationshipList" name="relationship-list" type="inventory.aai.openecomp.org.v9.RelationshipList" /> + </java-attributes> + <xml-properties> + <xml-property name="description" value="General purpose VNF" /> + <xml-property name="nameProps" value="vnf-name" /> + <xml-property name="indexedProps" value="is-closed-loop-disabled,vnf-name2,vnf-type,heat-stack-id,in-maint,vnf-name,vnf-id,regional-resource-zone,prov-status,service-id,persona-model-id,persona-model-version,widget-model-id,widget-model-version" /> + <xml-property name="searchable" value="vnf-id,vnf-name,vnf-name2" /> + <xml-property name="uniqueProps" value="vnf-id" /> + <xml-property name="container" value="test-objects" /> + <xml-property name="namespace" value="network" /> + <xml-property name="extends" value="vnf" /> + </xml-properties> + </java-type> </java-types> </xml-bindings> |