diff options
author | Dan Timoney <dtimoney@att.com> | 2017-07-18 20:23:07 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2017-08-01 14:46:48 -0400 |
commit | 5363b2782d906a6c6067eb840392f959ed4dfe4b (patch) | |
tree | b8061a4875ea11c6af51ce065c300ef2dd4746ef /aai-service/provider | |
parent | bbe551f0d98ca20f604c03a24c1b8e7bad27008a (diff) |
[CCSDK-6] Populate seed code
Add seed code for sli/adaptors repository
Update code to use org.onap.ccsdk.sli.core
Change-Id: I477c7a24f2cc1fed8fb0975fe9f33733411c27f9
Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'aai-service/provider')
67 files changed, 21022 insertions, 0 deletions
diff --git a/aai-service/provider/pom.xml b/aai-service/provider/pom.xml new file mode 100755 index 00000000..d6d72f20 --- /dev/null +++ b/aai-service/provider/pom.xml @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.openecomp.sdnc.adaptors</groupId> + <artifactId>aai-service</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>aai-service-provider</artifactId> + <packaging>bundle</packaging> + <name>AAI Interface Service - Provider</name> + <url>http://maven.apache.org</url> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-all</artifactId> + <version>${mockito.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-common</artifactId> + <version>${sdnctl.sli.version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-provider</artifactId> + <version>${sdnctl.sli.version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>equinoxSDK381</groupId> + <artifactId>org.eclipse.osgi</artifactId> + <version>${equinox.osgi.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-client</artifactId> + <version>${jersey.client.version}</version> + </dependency> + <dependency> + <groupId>com.sun.jersey</groupId> + <artifactId>jersey-core</artifactId> + <version>${jersey.version}</version> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore-osgi</artifactId> + <version>${apache.httpcomponents.core.version}</version> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient-osgi</artifactId> + <version>${apache.httpcomponents.client.version}</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <!-- <type>bundle</type> --> + <version>${jackson.version}</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.module</groupId> + <artifactId>jackson-module-jaxb-annotations</artifactId> + <version>${jackson.version}</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + <!-- <type>bundle</type> --> + <version>${jackson.version}</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <!-- <type>bundle</type> --> + <version>${jackson.version}</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>${commons.lang.version}</version> + </dependency> + <dependency> + <groupId>org.jvnet.jaxb2_commons</groupId> + <artifactId>jaxb2-basics-runtime</artifactId> + <version>0.6.4</version> + </dependency> + <dependency> + <groupId>org.jsoup</groupId> + <artifactId>jsoup</artifactId> + <version>1.8.3</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>4.3.5.RELEASE</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>${bundle.plugin.version}</version> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-SymbolicName>org.openecomp.sdnc.sli.aai</Bundle-SymbolicName> + <Bundle-Activator>org.openecomp.sdnc.sli.aai.AAIServiceActivator</Bundle-Activator> + <Export-Package>org.openecomp.sdnc.sli.aai.*,org.openecomp.aai.inventory.v10.*</Export-Package> + <Import-Package>org.openecomp.sdnc.sli.*,org.osgi.framework.*,org.slf4j.*,org.apache.commons.lang3.*,javax.xml.bind.annotation.*,javax.ws.rs.*,javax.ws.rs.core.*,com.fasterxml.jackson.module.jaxb.*,com.sun.jersey.client.urlconnection.*,com.sun.jersey.api.client.config.*,com.fasterxml.jackson.databind.type.*,com.fasterxml.jackson.module.jaxb.*,com.fasterxml.jackson.databind.introspect.*,com.fasterxml.jackson.annotation.*,com.fasterxml.jackson.databind.*</Import-Package> + <Import-Package>*</Import-Package> + <Embed-Transitive>true</Embed-Transitive> + </instructions> + + <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation> + </configuration> + </plugin> + <plugin> + <groupId>org.jvnet.jaxb2.maven2</groupId> + <artifactId>maven-jaxb2-plugin</artifactId> + <version>0.13.1</version> + <executions> + <execution> + <id>gen-xjc</id> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + <configuration> + <schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory> + <schemaIncludes> + <value>aai_schema_v10.xsd</value> + </schemaIncludes> + <bindingIncludes> + <include>aai-schema-bindings.xjb</include> + </bindingIncludes> + <generateDirectory>${project.build.directory}/generated-sources/main/java</generateDirectory> + <generatePackage>org.openecomp.aai.inventory.v10</generatePackage> + <extension>true</extension> + <args> + <arg>-Xannotate</arg> + </args> + <plugins> + <plugin> + <groupId>org.jvnet.jaxb2_commons</groupId> + <artifactId>jaxb2-basics-annotate</artifactId> + <version>0.6.4</version> + </plugin> + </plugins> + </configuration> + </plugin> + </plugins> + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings + only. It has no influence on the Maven build itself. --> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId> + com.brocade.developer + </groupId> + <artifactId> + providermodule-plugin + </artifactId> + <versionRange> + [1.2.0.100-SNAPSHOT,) + </versionRange> + <goals> + <goal>process</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore /> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> diff --git a/aai-service/provider/src/main/java/META-INF/sun-jaxb.episode b/aai-service/provider/src/main/java/META-INF/sun-jaxb.episode new file mode 100755 index 00000000..f14c7d47 --- /dev/null +++ b/aai-service/provider/src/main/java/META-INF/sun-jaxb.episode @@ -0,0 +1,376 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<bindings xmlns="http://java.sun.com/xml/ns/jaxb" if-exists="true" version="2.1"> + <!-- + +This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 +See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> +Any modifications to this file will be lost upon recompilation of the source schema. +Generated on: 2017.02.21 at 07:59:51 PM EST + + --> + <bindings xmlns:tns="http://org.openecomp.aai.inventory/v8" if-exists="true" scd="x-schema::tns"> + <schemaBindings map="false"> + <package name="org.openecomp.aai.inventory.v8"/> + </schemaBindings> + <bindings if-exists="true" scd="tns:model-element"> + <class ref="org.openecomp.aai.inventory.v8.ModelElement"/> + </bindings> + <bindings if-exists="true" scd="tns:named-query"> + <class ref="org.openecomp.aai.inventory.v8.NamedQuery"/> + </bindings> + <bindings if-exists="true" scd="tns:result-data"> + <class ref="org.openecomp.aai.inventory.v8.ResultData"/> + </bindings> + <bindings if-exists="true" scd="tns:search-results"> + <class ref="org.openecomp.aai.inventory.v8.SearchResults"/> + </bindings> + <bindings if-exists="true" scd="tns:search"> + <class ref="org.openecomp.aai.inventory.v8.Search"/> + </bindings> + <bindings if-exists="true" scd="tns:update-node-key"> + <class ref="org.openecomp.aai.inventory.v8.UpdateNodeKey"/> + </bindings> + <bindings if-exists="true" scd="tns:action-data"> + <class ref="org.openecomp.aai.inventory.v8.ActionData"/> + </bindings> + <bindings if-exists="true" scd="tns:action"> + <class ref="org.openecomp.aai.inventory.v8.Action"/> + </bindings> + <bindings if-exists="true" scd="tns:update"> + <class ref="org.openecomp.aai.inventory.v8.Update"/> + </bindings> + <bindings if-exists="true" scd="tns:key-data"> + <class ref="org.openecomp.aai.inventory.v8.KeyData"/> + </bindings> + <bindings if-exists="true" scd="tns:notify"> + <class ref="org.openecomp.aai.inventory.v8.Notify"/> + </bindings> + <bindings if-exists="true" scd="tns:actions"> + <class ref="org.openecomp.aai.inventory.v8.Actions"/> + </bindings> + <bindings if-exists="true" scd="tns:relationship-data"> + <class ref="org.openecomp.aai.inventory.v8.RelationshipData"/> + </bindings> + <bindings if-exists="true" scd="tns:related-to-property"> + <class ref="org.openecomp.aai.inventory.v8.RelatedToProperty"/> + </bindings> + <bindings if-exists="true" scd="tns:relationship"> + <class ref="org.openecomp.aai.inventory.v8.Relationship"/> + </bindings> + <bindings if-exists="true" scd="tns:relationship-list"> + <class ref="org.openecomp.aai.inventory.v8.RelationshipList"/> + </bindings> + <bindings if-exists="true" scd="tns:volume-group"> + <class ref="org.openecomp.aai.inventory.v8.VolumeGroup"/> + </bindings> + <bindings if-exists="true" scd="tns:volume-groups"> + <class ref="org.openecomp.aai.inventory.v8.VolumeGroups"/> + </bindings> + <bindings if-exists="true" scd="tns:volume"> + <class ref="org.openecomp.aai.inventory.v8.Volume"/> + </bindings> + <bindings if-exists="true" scd="tns:volumes"> + <class ref="org.openecomp.aai.inventory.v8.Volumes"/> + </bindings> + <bindings if-exists="true" scd="tns:l3-interface-ipv4-address-list"> + <class ref="org.openecomp.aai.inventory.v8.L3InterfaceIpv4AddressList"/> + </bindings> + <bindings if-exists="true" scd="tns:l3-interface-ipv6-address-list"> + <class ref="org.openecomp.aai.inventory.v8.L3InterfaceIpv6AddressList"/> + </bindings> + <bindings if-exists="true" scd="tns:vlan"> + <class ref="org.openecomp.aai.inventory.v8.Vlan"/> + </bindings> + <bindings if-exists="true" scd="tns:vlans"> + <class ref="org.openecomp.aai.inventory.v8.Vlans"/> + </bindings> + <bindings if-exists="true" scd="tns:l-interface"> + <class ref="org.openecomp.aai.inventory.v8.LInterface"/> + </bindings> + <bindings if-exists="true" scd="tns:l-interfaces"> + <class ref="org.openecomp.aai.inventory.v8.LInterfaces"/> + </bindings> + <bindings if-exists="true" scd="tns:vserver"> + <class ref="org.openecomp.aai.inventory.v8.Vserver"/> + </bindings> + <bindings if-exists="true" scd="tns:vservers"> + <class ref="org.openecomp.aai.inventory.v8.Vservers"/> + </bindings> + <bindings if-exists="true" scd="tns:tenant"> + <class ref="org.openecomp.aai.inventory.v8.Tenant"/> + </bindings> + <bindings if-exists="true" scd="tns:tenants"> + <class ref="org.openecomp.aai.inventory.v8.Tenants"/> + </bindings> + <bindings if-exists="true" scd="tns:flavor"> + <class ref="org.openecomp.aai.inventory.v8.Flavor"/> + </bindings> + <bindings if-exists="true" scd="tns:flavors"> + <class ref="org.openecomp.aai.inventory.v8.Flavors"/> + </bindings> + <bindings if-exists="true" scd="tns:group-assignment"> + <class ref="org.openecomp.aai.inventory.v8.GroupAssignment"/> + </bindings> + <bindings if-exists="true" scd="tns:group-assignments"> + <class ref="org.openecomp.aai.inventory.v8.GroupAssignments"/> + </bindings> + <bindings if-exists="true" scd="tns:snapshot"> + <class ref="org.openecomp.aai.inventory.v8.Snapshot"/> + </bindings> + <bindings if-exists="true" scd="tns:snapshots"> + <class ref="org.openecomp.aai.inventory.v8.Snapshots"/> + </bindings> + <bindings if-exists="true" scd="tns:metadatum"> + <class ref="org.openecomp.aai.inventory.v8.Metadatum"/> + </bindings> + <bindings if-exists="true" scd="tns:metadata"> + <class ref="org.openecomp.aai.inventory.v8.Metadata"/> + </bindings> + <bindings if-exists="true" scd="tns:image"> + <class ref="org.openecomp.aai.inventory.v8.Image"/> + </bindings> + <bindings if-exists="true" scd="tns:images"> + <class ref="org.openecomp.aai.inventory.v8.Images"/> + </bindings> + <bindings if-exists="true" scd="tns:availability-zone"> + <class ref="org.openecomp.aai.inventory.v8.AvailabilityZone"/> + </bindings> + <bindings if-exists="true" scd="tns:availability-zones"> + <class ref="org.openecomp.aai.inventory.v8.AvailabilityZones"/> + </bindings> + <bindings if-exists="true" scd="tns:cloud-region"> + <class ref="org.openecomp.aai.inventory.v8.CloudRegion"/> + </bindings> + <bindings if-exists="true" scd="tns:cloud-regions"> + <class ref="org.openecomp.aai.inventory.v8.CloudRegions"/> + </bindings> + <bindings if-exists="true" scd="tns:p-interface"> + <class ref="org.openecomp.aai.inventory.v8.PInterface"/> + </bindings> + <bindings if-exists="true" scd="tns:p-interfaces"> + <class ref="org.openecomp.aai.inventory.v8.PInterfaces"/> + </bindings> + <bindings if-exists="true" scd="tns:lag-interface"> + <class ref="org.openecomp.aai.inventory.v8.LagInterface"/> + </bindings> + <bindings if-exists="true" scd="tns:lag-interfaces"> + <class ref="org.openecomp.aai.inventory.v8.LagInterfaces"/> + </bindings> + <bindings if-exists="true" scd="tns:pserver"> + <class ref="org.openecomp.aai.inventory.v8.Pserver"/> + </bindings> + <bindings if-exists="true" scd="tns:pservers"> + <class ref="org.openecomp.aai.inventory.v8.Pservers"/> + </bindings> + <bindings if-exists="true" scd="tns:cloud-infrastructure"> + <class ref="org.openecomp.aai.inventory.v8.CloudInfrastructure"/> + </bindings> + <bindings if-exists="true" scd="tns:service-instance"> + <class ref="org.openecomp.aai.inventory.v8.ServiceInstance"/> + </bindings> + <bindings if-exists="true" scd="tns:service-instances"> + <class ref="org.openecomp.aai.inventory.v8.ServiceInstances"/> + </bindings> + <bindings if-exists="true" scd="tns:service-subscription"> + <class ref="org.openecomp.aai.inventory.v8.ServiceSubscription"/> + </bindings> + <bindings if-exists="true" scd="tns:service-subscriptions"> + <class ref="org.openecomp.aai.inventory.v8.ServiceSubscriptions"/> + </bindings> + <bindings if-exists="true" scd="tns:customer"> + <class ref="org.openecomp.aai.inventory.v8.Customer"/> + </bindings> + <bindings if-exists="true" scd="tns:customers"> + <class ref="org.openecomp.aai.inventory.v8.Customers"/> + </bindings> + <bindings if-exists="true" scd="tns:business"> + <class ref="org.openecomp.aai.inventory.v8.Business"/> + </bindings> + <bindings if-exists="true" scd="tns:service"> + <class ref="org.openecomp.aai.inventory.v8.Service"/> + </bindings> + <bindings if-exists="true" scd="tns:services"> + <class ref="org.openecomp.aai.inventory.v8.Services"/> + </bindings> + <bindings if-exists="true" scd="tns:element-choice-set"> + <class ref="org.openecomp.aai.inventory.v8.ElementChoiceSet"/> + </bindings> + <bindings if-exists="true" scd="tns:model-elements"> + <class ref="org.openecomp.aai.inventory.v8.ModelElements"/> + </bindings> + <bindings if-exists="true" scd="tns:model-constraints"> + <class ref="org.openecomp.aai.inventory.v8.ModelConstraints"/> + </bindings> + <bindings if-exists="true" scd="tns:model-constraint"> + <class ref="org.openecomp.aai.inventory.v8.ModelConstraint"/> + </bindings> + <bindings if-exists="true" scd="tns:constrained-element-sets"> + <class ref="org.openecomp.aai.inventory.v8.ConstrainedElementSets"/> + </bindings> + <bindings if-exists="true" scd="tns:constrained-element-set"> + <class ref="org.openecomp.aai.inventory.v8.ConstrainedElementSet"/> + </bindings> + <bindings if-exists="true" scd="tns:element-choice-sets"> + <class ref="org.openecomp.aai.inventory.v8.ElementChoiceSets"/> + </bindings> + <bindings if-exists="true" scd="tns:model"> + <class ref="org.openecomp.aai.inventory.v8.Model"/> + </bindings> + <bindings if-exists="true" scd="tns:models"> + <class ref="org.openecomp.aai.inventory.v8.Models"/> + </bindings> + <bindings if-exists="true" scd="tns:related-lookup"> + <class ref="org.openecomp.aai.inventory.v8.RelatedLookup"/> + </bindings> + <bindings if-exists="true" scd="tns:related-lookups"> + <class ref="org.openecomp.aai.inventory.v8.RelatedLookups"/> + </bindings> + <bindings if-exists="true" scd="tns:property-constraint"> + <class ref="org.openecomp.aai.inventory.v8.PropertyConstraint"/> + </bindings> + <bindings if-exists="true" scd="tns:property-constraints"> + <class ref="org.openecomp.aai.inventory.v8.PropertyConstraints"/> + </bindings> + <bindings if-exists="true" scd="tns:named-query-element"> + <class ref="org.openecomp.aai.inventory.v8.NamedQueryElement"/> + </bindings> + <bindings if-exists="true" scd="tns:named-query-elements"> + <class ref="org.openecomp.aai.inventory.v8.NamedQueryElements"/> + </bindings> + <bindings if-exists="true" scd="tns:named-queries"> + <class ref="org.openecomp.aai.inventory.v8.NamedQueries"/> + </bindings> + <bindings if-exists="true" scd="tns:service-design-and-creation"> + <class ref="org.openecomp.aai.inventory.v8.ServiceDesignAndCreation"/> + </bindings> + <bindings if-exists="true" scd="tns:logical-link"> + <class ref="org.openecomp.aai.inventory.v8.LogicalLink"/> + </bindings> + <bindings if-exists="true" scd="tns:logical-links"> + <class ref="org.openecomp.aai.inventory.v8.LogicalLinks"/> + </bindings> + <bindings if-exists="true" scd="tns:vnfc"> + <class ref="org.openecomp.aai.inventory.v8.Vnfc"/> + </bindings> + <bindings if-exists="true" scd="tns:vnfcs"> + <class ref="org.openecomp.aai.inventory.v8.Vnfcs"/> + </bindings> + <bindings if-exists="true" scd="tns:subnet"> + <class ref="org.openecomp.aai.inventory.v8.Subnet"/> + </bindings> + <bindings if-exists="true" scd="tns:subnets"> + <class ref="org.openecomp.aai.inventory.v8.Subnets"/> + </bindings> + <bindings if-exists="true" scd="tns:ctag-assignment"> + <class ref="org.openecomp.aai.inventory.v8.CtagAssignment"/> + </bindings> + <bindings if-exists="true" scd="tns:ctag-assignments"> + <class ref="org.openecomp.aai.inventory.v8.CtagAssignments"/> + </bindings> + <bindings if-exists="true" scd="tns:segmentation-assignment"> + <class ref="org.openecomp.aai.inventory.v8.SegmentationAssignment"/> + </bindings> + <bindings if-exists="true" scd="tns:segmentation-assignments"> + <class ref="org.openecomp.aai.inventory.v8.SegmentationAssignments"/> + </bindings> + <bindings if-exists="true" scd="tns:l3-network"> + <class ref="org.openecomp.aai.inventory.v8.L3Network"/> + </bindings> + <bindings if-exists="true" scd="tns:l3-networks"> + <class ref="org.openecomp.aai.inventory.v8.L3Networks"/> + </bindings> + <bindings if-exists="true" scd="tns:vf-module"> + <class ref="org.openecomp.aai.inventory.v8.VfModule"/> + </bindings> + <bindings if-exists="true" scd="tns:vf-modules"> + <class ref="org.openecomp.aai.inventory.v8.VfModules"/> + </bindings> + <bindings if-exists="true" scd="tns:generic-vnf"> + <class ref="org.openecomp.aai.inventory.v8.GenericVnf"/> + </bindings> + <bindings if-exists="true" scd="tns:generic-vnfs"> + <class ref="org.openecomp.aai.inventory.v8.GenericVnfs"/> + </bindings> + <bindings if-exists="true" scd="tns:pnf"> + <class ref="org.openecomp.aai.inventory.v8.Pnf"/> + </bindings> + <bindings if-exists="true" scd="tns:pnfs"> + <class ref="org.openecomp.aai.inventory.v8.Pnfs"/> + </bindings> + <bindings if-exists="true" scd="tns:physical-link"> + <class ref="org.openecomp.aai.inventory.v8.PhysicalLink"/> + </bindings> + <bindings if-exists="true" scd="tns:physical-links"> + <class ref="org.openecomp.aai.inventory.v8.PhysicalLinks"/> + </bindings> + <bindings if-exists="true" scd="tns:network"> + <class ref="org.openecomp.aai.inventory.v8.Network"/> + </bindings> + <bindings if-exists="true" scd="tns:reserved-prop-names"> + <class ref="org.openecomp.aai.inventory.v8.ReservedPropNames"/> + </bindings> + <bindings if-exists="true" scd="tns:edge-prop-names"> + <class ref="org.openecomp.aai.inventory.v8.EdgePropNames"/> + </bindings> + <bindings if-exists="true" scd="tns:aai-internal"> + <class ref="org.openecomp.aai.inventory.v8.AaiInternal"/> + </bindings> + <bindings if-exists="true" scd="tns:inventory"> + <class ref="org.openecomp.aai.inventory.v8.Inventory"/> + </bindings> + <bindings if-exists="true" scd="tns:inventory-item-data"> + <class ref="org.openecomp.aai.inventory.v8.InventoryItemData"/> + </bindings> + <bindings if-exists="true" scd="tns:inventory-item"> + <class ref="org.openecomp.aai.inventory.v8.InventoryItem"/> + </bindings> + <bindings if-exists="true" scd="tns:tagged-inventory-item-list"> + <class ref="org.openecomp.aai.inventory.v8.TaggedInventoryItemList"/> + </bindings> + <bindings if-exists="true" scd="tns:start-node-filter"> + <class ref="org.openecomp.aai.inventory.v8.StartNodeFilter"/> + </bindings> + <bindings if-exists="true" scd="tns:include-node-filter"> + <class ref="org.openecomp.aai.inventory.v8.IncludeNodeFilter"/> + </bindings> + <bindings if-exists="true" scd="tns:secondary-filter"> + <class ref="org.openecomp.aai.inventory.v8.SecondaryFilter"/> + </bindings> + <bindings if-exists="true" scd="tns:notification-event-header"> + <class ref="org.openecomp.aai.inventory.v8.NotificationEventHeader"/> + </bindings> + <bindings if-exists="true" scd="tns:notification-event"> + <class ref="org.openecomp.aai.inventory.v8.NotificationEvent"/> + </bindings> + <bindings if-exists="true" scd="tns:query-parameters"> + <class ref="org.openecomp.aai.inventory.v8.QueryParameters"/> + </bindings> + <bindings if-exists="true" scd="tns:instance-filter"> + <class ref="org.openecomp.aai.inventory.v8.InstanceFilter"/> + </bindings> + <bindings if-exists="true" scd="tns:instance-filters"> + <class ref="org.openecomp.aai.inventory.v8.InstanceFilters"/> + </bindings> + <bindings if-exists="true" scd="tns:model-and-named-query-search"> + <class ref="org.openecomp.aai.inventory.v8.ModelAndNamedQuerySearch"/> + </bindings> + <bindings if-exists="true" scd="tns:properties"> + <class ref="org.openecomp.aai.inventory.v8.Properties"/> + </bindings> + <bindings if-exists="true" scd="tns:extra-properties"> + <class ref="org.openecomp.aai.inventory.v8.ExtraProperties"/> + </bindings> + <bindings if-exists="true" scd="tns:inventory-response-item"> + <class ref="org.openecomp.aai.inventory.v8.InventoryResponseItem"/> + </bindings> + <bindings if-exists="true" scd="tns:inventory-response-items"> + <class ref="org.openecomp.aai.inventory.v8.InventoryResponseItems"/> + </bindings> + <bindings if-exists="true" scd="tns:response-list"> + <class ref="org.openecomp.aai.inventory.v8.ResponseList"/> + </bindings> + <bindings if-exists="true" scd="tns:extra-property"> + <class ref="org.openecomp.aai.inventory.v8.ExtraProperty"/> + </bindings> + </bindings> +</bindings> diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIClient.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIClient.java new file mode 100644 index 00000000..05921203 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIClient.java @@ -0,0 +1,220 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.IOException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; +import org.openecomp.aai.inventory.v10.AvailabilityZone; +import org.openecomp.aai.inventory.v10.Complex; +import org.openecomp.aai.inventory.v10.CtagPool; +import org.openecomp.aai.inventory.v10.DvsSwitch; +import org.openecomp.aai.inventory.v10.GenericVnf; +import org.openecomp.aai.inventory.v10.L3Network; +import org.openecomp.aai.inventory.v10.OamNetwork; +import org.openecomp.aai.inventory.v10.PInterface; +import org.openecomp.aai.inventory.v10.PhysicalLink; +import org.openecomp.aai.inventory.v10.Pserver; +import org.openecomp.aai.inventory.v10.SearchResults; +import org.openecomp.aai.inventory.v10.Service; +import org.openecomp.aai.inventory.v10.ServiceInstance; +import org.openecomp.aai.inventory.v10.SitePairSet; +import org.openecomp.aai.inventory.v10.Tenant; +import org.openecomp.aai.inventory.v10.Vce; +import org.openecomp.aai.inventory.v10.VnfImage; +import org.openecomp.aai.inventory.v10.Vpe; +import org.openecomp.aai.inventory.v10.VplsPe; +import org.openecomp.aai.inventory.v10.VpnBinding; +import org.openecomp.aai.inventory.v10.Vserver; +import org.openecomp.sdnc.sli.aai.data.notify.NotifyEvent; +import org.openecomp.sdnc.sli.aai.data.v1507.VServer; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; + +public interface AAIClient extends SvcLogicResource, SvcLogicJavaPlugin { + + // VCE + public boolean postNetworkVceData(String vnf_id, Vce request) throws AAIServiceException; + public Vce requestNetworkVceData(String vnf_id) throws AAIServiceException; + public boolean deleteNetworkVceData(String vnf_id, String resourceVersion) throws AAIServiceException; + + // Service Inteface + public ServiceInstance requestServiceInterfaceData(String customer_id, String service_type, String svc_instance_id) throws AAIServiceException; + public boolean postServiceInterfaceData(String customer_id, String service_type, String svc_instance_id, ServiceInstance request) throws AAIServiceException; + public SearchResults requestServiceInstanceURL(String svc_instance_id) throws AAIServiceException; + + // VPE +// public Vpes requestNetworkVpeList() throws AAIServiceException; + public Vpe requestNetworkVpeData(String vnf_id) throws AAIServiceException; + public boolean postNetworkVpeData(String vnf_id, Vpe request) throws AAIServiceException; + public boolean deleteNetworkVpeData(String vnf_id, String resourceVersion) throws AAIServiceException; + + // VServers + public Vserver requestVServerData(String tenant_id, String vserver_id, String cloudOwner, String cloudRegionId) throws AAIServiceException; + public boolean postVServerData(String tenantId, String vserverId, String cloudOwner, String cloudRegionId, Vserver request) throws AAIServiceException; + public boolean deleteVServerData(String tenant_id, String vserver_id, String cloudOwner, String cloudRegionId, String resourceVersion) throws AAIServiceException; + + public URL requestVserverURLNodeQuery(String vserver_name) throws AAIServiceException; + public String getTenantIdFromVserverUrl(URL url); + public String getCloudOwnerFromVserverUrl(URL url); + public String getCloudRegionFromVserverUrl(URL url); + public String getVServerIdFromVserverUrl(URL url, String tennantId); + public Vserver requestVServerDataByURL(URL url) throws AAIServiceException; + + // VPLS-PE + public VplsPe requestNetworkVplsPeData(String equipment_name) throws AAIServiceException; + public boolean postNetworkVplsPeData(String vnf_id, VplsPe request) throws AAIServiceException; + public boolean deleteNetworkVplsPeData(String vnf_id, String resourceVersion) throws AAIServiceException; + + + // Complexes + public Complex requestNetworkComplexData(String vnf_id) throws AAIServiceException; + public boolean postNetworkComplexData(String vnf_id, Complex request) throws AAIServiceException; + public boolean deleteNetworkComplexData(String vnf_id, String resourceVersion) throws AAIServiceException; + + // CTag Pool + public CtagPool requestCtagPoolData(String physical_location_id, String target_pe, String availability_zone_name) throws AAIServiceException; + + // --------------------------------- 1507 --------------------------- + // Data Change + public VServer dataChangeRequestVServerData(URL url) throws AAIServiceException; + + public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException; + + public VplsPe dataChangeRequestVplsPeData(URL url) throws AAIServiceException; + + public Vpe dataChangeRequestVpeData(URL url) throws AAIServiceException; + + public DvsSwitch dataChangeRequestDvsSwitchData(URL url) throws AAIServiceException; + + public Pserver dataChangeRequestPServerData(URL url) throws AAIServiceException; + + //OAM-Network: + public OamNetwork dataChangeRequestOAMNetworkData(URL url) throws AAIServiceException; + //Availability-Zone: + public AvailabilityZone dataChangeRequestAvailabilityZoneData(URL url) throws AAIServiceException; + //Complex: + public Complex dataChangeRequestComplexData(URL url) throws AAIServiceException; + + + /* DELETE */ + public boolean dataChangeDeleteVServerData(URL url) throws AAIServiceException; + + public boolean dataChangeDeleteCtagPoolData(URL url) throws AAIServiceException; + + public boolean dataChangeDeleteVplsPeData(URL url) throws AAIServiceException; + + public boolean dataChangeDeleteVpeData(URL url) throws AAIServiceException; + + public boolean dataChangeDeleteDvsSwitchData(URL url) throws AAIServiceException; + //OAM-Network: + public boolean dataChangeDeleteOAMNetworkData(URL url) throws AAIServiceException; + //Availability-Zone: + public boolean dataChangeDeleteAvailabilityZoneData(URL url) throws AAIServiceException; + //Complex: + public boolean dataChangeDeleteComplexData(URL url) throws AAIServiceException; + + // ----------------- Release 1510 ---------------------- + // // GenericVNF + public GenericVnf requestGenericVnfData(String vnf_id) throws AAIServiceException; + public boolean postGenericVnfData(String vnf_id, GenericVnf request) throws AAIServiceException; + public boolean deleteGenericVnfData(String vnf_id, String resourceVersion) throws AAIServiceException; + + // DvsSwitch + public DvsSwitch requestDvsSwitchData(String vnf_id) throws AAIServiceException; + public boolean postDvsSwitchData(String vnf_id, DvsSwitch request) throws AAIServiceException; + public boolean deleteDvsSwitchData(String vnf_id, String resourceVersion) throws AAIServiceException; + + // PInterface + public PInterface requestPInterfaceData(String hostname, String interfaceName) throws AAIServiceException; + public boolean postPInterfaceData(String hostname, String interfaceName, PInterface request) throws AAIServiceException; + public boolean deletePInterfaceData(String hostname, String interfaceName, String resourceVersion) throws AAIServiceException; + + // Physical Link + public PhysicalLink requestPhysicalLinkData(String vnf_id) throws AAIServiceException; + public boolean postPhysicalLinkData(String vnf_id, PhysicalLink request) throws AAIServiceException; + public boolean deletePhysicalLinkData(String vnf_id, String resourceVersion) throws AAIServiceException; + + // PServers + public Pserver requestPServerData(String hostname) throws AAIServiceException; + public boolean postPServerData(String hostname, Pserver server) throws AAIServiceException; + public boolean deletePServerData(String hostname, String resourceVersion) throws AAIServiceException; + + // L3Networks + public L3Network requestL3NetworkData(String networkId) throws AAIServiceException; + public L3Network requestL3NetworkQueryByName(String networkId) throws AAIServiceException; + public boolean postL3NetworkData(String networkId, L3Network request) throws AAIServiceException; + public boolean deleteL3NetworkData(String networkId, String resourceVersion) throws AAIServiceException; + + // Vpn Bindings + public VpnBinding requestVpnBindingData(String vpnId) throws AAIServiceException; +// public boolean postVpnBindingData(String vpnId, VpnBinding request) throws AAIServiceException; + public boolean deleteVpnBindingData(String vpnId, String resourceVersion) throws AAIServiceException; + + //VnfImage + public VnfImage requestVnfImageData(String vpnId) throws AAIServiceException; + public VnfImage requestVnfImageDataByVendorModel(String vendor, String model) throws AAIServiceException; + public VnfImage requestVnfImageDataByVendorModelVersion(String vendor, String model, String version) throws AAIServiceException; + + // UBB Notify + public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException; + + // 1512 + // Site Pair Site + public SitePairSet requestSitePairSetData(String sitePairSetId) throws AAIServiceException; + public boolean postSitePairSetData(String sitePairSetId, SitePairSet request) throws AAIServiceException; + public boolean deleteSitePairSetData(String sitePairSetId, String resourceVersion) throws AAIServiceException; + + // Services + public Service requestServiceData(String serviceId) throws AAIServiceException; + public boolean postServiceData(String serviceId, Service request) throws AAIServiceException; + public boolean deleteServiceData(String serviceId, String resourceVersion) throws AAIServiceException; + + // Node Query - 1602 + public SearchResults requestNodeQuery(String type, String entityIdentifier, String entityName) throws AAIServiceException; + public String requestDataByURL(URL url) throws AAIServiceException; +// public Object requestDataInstanceNodeQuery(String type, String vnf_name) throws AAIServiceException; + public GenericVnf requestGenericVnfeNodeQuery(String vnf_name) throws AAIServiceException; + + // // tenant + public Tenant requestTenantData(String tenant_id, String cloudOwner, String cloudRegionId) throws AAIServiceException; + public Tenant requestTenantDataByName(String tenant_name, String cloudOwner, String cloudRegionId) throws AAIServiceException; + public boolean postTenantData(String tenant_id, String cloudOwner, String cloudRegionId, Tenant request) throws AAIServiceException; +// public boolean deleteGenericVnfData(String vnf_id, String resourceVersion) throws AAIServiceException; + + + public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException; + public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException; + + public void logKeyError(String keys); + + public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix, SvcLogicContext ctx, HashMap<String, String> nameValues, String modifier) throws JsonParseException, JsonMappingException, IOException, AAIServiceException ; + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIDeclarations.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIDeclarations.java new file mode 100644 index 00000000..cee0847b --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIDeclarations.java @@ -0,0 +1,2045 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.xml.bind.annotation.XmlType; + +import org.apache.commons.lang.StringUtils; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; +import org.openecomp.aai.inventory.v10.GenericVnf; +import org.openecomp.aai.inventory.v10.InventoryResponseItem; +import org.openecomp.aai.inventory.v10.InventoryResponseItems; +import org.openecomp.aai.inventory.v10.L3Network; +import org.openecomp.aai.inventory.v10.LogicalLink; +import org.openecomp.aai.inventory.v10.Metadata; +import org.openecomp.aai.inventory.v10.Metadatum; +import org.openecomp.aai.inventory.v10.Pnf; +import org.openecomp.aai.inventory.v10.Relationship; +import org.openecomp.aai.inventory.v10.RelationshipData; +import org.openecomp.aai.inventory.v10.RelationshipList; +import org.openecomp.aai.inventory.v10.ResultData; +import org.openecomp.aai.inventory.v10.SearchResults; +import org.openecomp.aai.inventory.v10.ServiceInstance; +import org.openecomp.aai.inventory.v10.Vlan; +import org.openecomp.aai.inventory.v10.Vlans; +import org.openecomp.aai.inventory.v10.Vserver; +import org.openecomp.sdnc.sli.aai.AAIService.AAIRequestExecutor; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.openecomp.sdnc.sli.aai.query.FormattedQueryResultList; +import org.openecomp.sdnc.sli.aai.query.InstanceFilter; +import org.openecomp.sdnc.sli.aai.query.InstanceFilters; +import org.openecomp.sdnc.sli.aai.query.NamedQuery; +import org.openecomp.sdnc.sli.aai.query.NamedQueryData; +import org.openecomp.sdnc.sli.aai.query.QueryParameters; +import org.openecomp.sdnc.sli.aai.query.Results; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + + +public abstract class AAIDeclarations implements AAIClient { + + public static final String TRUSTSTORE_PATH = "org.openecomp.sdnc.sli.aai.ssl.trust"; + public static final String TRUSTSTORE_PSSWD = "org.openecomp.sdnc.sli.aai.ssl.trust.psswd"; + public static final String KEYSTORE_PATH = "org.openecomp.sdnc.sli.aai.ssl.key"; + public static final String KEYSTORE_PSSWD = "org.openecomp.sdnc.sli.aai.ssl.key.psswd"; + + public static final String APPLICATION_ID = "org.openecomp.sdnc.sli.aai.application"; + + public static final String CLIENT_NAME = "org.openecomp.sdnc.sli.aai.client.name"; + public static final String CLIENT_PWWD = "org.openecomp.sdnc.sli.aai.client.psswd"; + + + public static final String CONNECTION_TIMEOUT = "connection.timeout"; + public static final String READ_TIMEOUT = "read.timeout"; + + public static final String TARGET_URI = "org.openecomp.sdnc.sli.aai.uri"; + + // Availability zones query + public static final String QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.query"; + + // Update + public static final String UPDATE_PATH = "org.openecomp.sdnc.sli.aai.update"; + + // Service instance + public static final String SVC_INSTANCE_PATH = "org.openecomp.sdnc.sli.aai.path.svcinst"; + public static final String SVC_INST_QRY_PATH = "org.openecomp.sdnc.sli.aai.path.svcinst.query"; + + // VServer + public static final String NETWORK_VSERVER_PATH = "org.openecomp.sdnc.sli.aai.path.vserver"; + + public static final String VNF_IMAGE_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.vnf.image.query"; + + public static final String PARAM_SERVICE_TYPE = "org.openecomp.sdnc.sli.aai.param.service.type"; + public static final String CERTIFICATE_HOST_ERROR = "org.openecomp.sdnc.sli.aai.host.certificate.ignore"; + + // UBB Notify + public static final String UBB_NOTIFY_PATH = "org.openecomp.sdnc.sli.aai.path.notify"; + public static final String SELFLINK_AVPN = "org.openecomp.sdnc.sli.aai.notify.selflink.avpn"; + public static final String SELFLINK_FQDN = "org.openecomp.sdnc.sli.aai.notify.selflink.fqdn"; + + //Service + public static final String SERVICE_PATH = "org.openecomp.sdnc.sli.aai.path.service"; + + // P-Interfaces + public static final String P_INTERFACE_PATH = "org.openecomp.sdnc.sli.aai.path.pserver.pinterface"; + + // site-pair-sets + public static final String SITE_PAIR_SET_PATH = "org.openecomp.sdnc.sli.aai.path.site.pair.set"; + + // node query (1602) + public static final String QUERY_NODES_PATH = "org.openecomp.sdnc.sli.aai.query.nodes"; + + + protected abstract Logger getLogger(); + public abstract AAIRequestExecutor getExecutor(); + + + @Override + public QueryStatus query(String resource, boolean localOnly, String select, String key, String prefix, String orderBy, SvcLogicContext ctx) + throws SvcLogicException { + + getLogger().debug("AAIService.query \tresource = "+resource); + + String vnfId = null; + String vnfName = null; + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + getLogger().debug("key = "+ nameValues.toString()); + + if(!checkOldFormat(resource, nameValues)) { + ctx.setAttribute(String.format("%s.error.message", prefix), String.format("Resource %s is not supported. Key string contains invaid identifiers", resource)); + return QueryStatus.FAILURE; + } + + if(resource == null || resource.isEmpty() || AAIRequest.createRequest(resource, nameValues) == null) { + ctx.setAttribute(String.format("%s.error.message", prefix), String.format("Resource %s is not supported", resource)); + return QueryStatus.FAILURE; + } + + // process data using new model + boolean useNewModelProcessing = true; + // process server query by name the old way + if(("vserver".equals(resource) || "vserver2".equals(resource))){ + if(nameValues.containsKey("vserver_name") || nameValues.containsKey("vserver-name") || nameValues.containsKey("vserver.vserver_name") || nameValues.containsKey("vserver.vserver-name")) + useNewModelProcessing = false; + } + if("generic-vnf".equals(resource)){ + if(nameValues.containsKey("vnf_name") || nameValues.containsKey("vnf-name") || nameValues.containsKey("generic_vnf.vnf_name") || nameValues.containsKey("generic-vnf.vnf-name")) + useNewModelProcessing = false; + } + + // process data using new model + if(useNewModelProcessing && AAIRequest.createRequest(resource, nameValues) != null) { + + try { + return newModelQuery(resource, localOnly, select, key, prefix, orderBy, ctx); + } catch (Exception exc) { + getLogger().warn("Failed query - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + } + + ObjectMapper mapper = AAIService.getObjectMapper(); + Map<String,Object> attributes = new HashMap<String,Object>(); + + String modifier = null; + + if(resource.contains(":")) { + String[] tokens = resource.split(":"); + resource = tokens[0]; + if(tokens.length > 1) { + modifier = tokens[1]; + } + } + + resource = resource.toLowerCase().replace("-", "_"); + + try { + + switch(resource) { + case "generic_vnf": + vnfId = nameValues.get("vnf_id"); + if(nameValues.containsKey("vnf_id")) + vnfId = nameValues.get("vnf_id"); + else if(nameValues.containsKey("generic_vnf.vnf_name")) + vnfId = nameValues.get("generic_vnf.vserver_name"); + + if(nameValues.containsKey("vnf_name")) + vnfName = nameValues.get("vnf_name"); + else if(nameValues.containsKey("generic_vnf.vnf_name")) + vnfName = nameValues.get("generic_vnf.vnf_name"); + + if(vnfId != null && !vnfId.isEmpty()) { + // at this point of the project this part should not be executed + vnfId = vnfId.trim().replace("'", "").replace("$", "").replace("'", ""); + GenericVnf vnf = this.requestGenericVnfData(vnfId); + if(vnf == null) { + return QueryStatus.NOT_FOUND; + } + + attributes = mapper.convertValue(vnf, attributes.getClass()); + } else if(vnfName != null && !vnfName.isEmpty()) { + try { + vnfName = vnfName.trim().replace("'", "").replace("$", "").replace("'", ""); + GenericVnf vnf = this.requestGenericVnfeNodeQuery(vnfName); + if(vnf == null) { + return QueryStatus.NOT_FOUND; + } + vnfId=vnf.getVnfId(); + nameValues.put("vnf_id", vnfId); + attributes = mapper.convertValue(vnf, attributes.getClass()); + } catch (AAIServiceException exc) { + int errorCode = exc.getReturnCode(); + switch(errorCode) { + case 400: + case 404: + case 412: + break; + default: + getLogger().warn("Caught exception trying to refresh generic VNF", exc); + } + ctx.setAttribute(prefix + ".error.message", exc.getMessage()); + if(errorCode >= 300) { + ctx.setAttribute(prefix + ".error.http.response-code", "" + exc.getReturnCode()); + } + return QueryStatus.FAILURE; + } + } else { + getLogger().warn("No arguments are available to process generic VNF"); + return QueryStatus.FAILURE; + } + break; + case "vserver": + case "vserver2": + String vserverName = null; + if(nameValues.containsKey("vserver_name")) + vserverName = nameValues.get("vserver_name"); + else if(nameValues.containsKey("vserver.vserver_name")) + vserverName = nameValues.get("vserver.vserver_name"); + + String vserverId = null; + if(nameValues.containsKey("vserver_id")) + vserverId = nameValues.get("vserver_id"); + if(nameValues.containsKey("vserver.vserver_id")) + vserverId = nameValues.get("vserver.vserver_id"); + String tenantId = nameValues.get("teannt_id"); + + if(vserverName != null) vserverName = vserverName.trim().replace("'", "").replace("$", "").replace("'", ""); + if(vserverId != null) vserverId = vserverId.trim().replace("'", "").replace("$", "").replace("'", ""); + if(tenantId != null) tenantId = tenantId.trim().replace("'", "").replace("$", "").replace("'", ""); + + if (vserverName != null) { + URL vserverUrl = null; + try { + vserverUrl = this.requestVserverURLNodeQuery(vserverName); + } catch (AAIServiceException aaiexc) { + ctx.setAttribute(prefix + ".error.message", aaiexc.getMessage()); + if (aaiexc.getReturnCode() >= 300) { + ctx.setAttribute(prefix + ".error.http.response-code", "" + aaiexc.getReturnCode()); + } + + if (aaiexc.getReturnCode() == 404) + return QueryStatus.NOT_FOUND; + else + return QueryStatus.FAILURE; + } + if (vserverUrl == null) { + return QueryStatus.NOT_FOUND; + } + + tenantId = getTenantIdFromVserverUrl(vserverUrl); + String cloudOwner = getCloudOwnerFromVserverUrl(vserverUrl); + String cloudRegionId = getCloudRegionFromVserverUrl(vserverUrl); + + Vserver vserver = null; + try { + vserver = this.requestVServerDataByURL(vserverUrl); + } catch (AAIServiceException aaiexc) { + ctx.setAttribute(prefix + ".error.message", aaiexc.getMessage()); + if (aaiexc.getReturnCode() >= 300) { + ctx.setAttribute(prefix + ".error.http.response-code", "" + aaiexc.getReturnCode()); + } + + if (aaiexc.getReturnCode() == 404) + return QueryStatus.NOT_FOUND; + else + return QueryStatus.FAILURE; + } + if (vserver == null) { + return QueryStatus.NOT_FOUND; + } + attributes = mapper.convertValue(vserver, attributes.getClass()); + if (!attributes.containsKey("tenant-id") && tenantId != null) { + attributes.put("tenant-id", tenantId); + } + if (!attributes.containsKey("cloud-owner") && cloudOwner != null) { + attributes.put("cloud-owner", cloudOwner); + } + if (!attributes.containsKey("cloud-region-id") && cloudRegionId != null) { + attributes.put("cloud-region-id", cloudRegionId); + } + } else if (vserverId != null && tenantId != null) { + Vserver vserver = this.requestVServerData(tenantId, vserverId, "att-aic", "AAIAIC25"); + if(vserver == null) { + return QueryStatus.NOT_FOUND; + } + attributes = mapper.convertValue(vserver, attributes.getClass()); + if(!attributes.containsKey("tenant-id") && tenantId != null){ + attributes.put("tenant-id", tenantId); + } + } else { + return QueryStatus.FAILURE; + } + break; + + default: + return QueryStatus.FAILURE; + } + + QueryStatus retval = QueryStatus.SUCCESS; + + if (attributes == null || attributes.isEmpty()) { + retval = QueryStatus.NOT_FOUND; + getLogger().debug("No data found"); + } else { + if (ctx != null) { + if (prefix != null) { + ArrayList<String> keys = new ArrayList<String>(attributes.keySet()); + + int numCols = keys.size(); + + for (int i = 0; i < numCols; i++) { + String colValue = null; + String colName = keys.get(i); + Object object = attributes.get(colName); + + if(object != null && object instanceof String) { + colValue = (String)object; + + if (prefix != null) { + getLogger().debug("Setting "+prefix + "." + colName.replaceAll("_", "-")+" = "+ colValue); + ctx.setAttribute(prefix + "." + colName.replaceAll("_", "-"), colValue); + } else { + getLogger().debug("Setting " + colValue.replaceAll("_", "-")+" = "+colValue); + ctx.setAttribute(colValue.replaceAll("_", "-"), colValue); + } + } else if(object != null && object instanceof Map) { + if(colName.equals(modifier) || colName.equals("relationship-list")){ + String localNodifier = modifier; + if(localNodifier == null) + localNodifier = "relationship-list"; + Map<String, Object> properties = (Map<String, Object>)object; + writeMap(properties, prefix+"."+localNodifier, ctx); + } + } + } + } + } + } + getLogger().debug("Query - returning " + retval); + return (retval); + + } catch (Exception exc) { + getLogger().warn("Failed query - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + +// return QueryStatus.SUCCESS; + } + + private boolean checkOldFormat(String resource, HashMap<String, String> nameValues) { + + switch(resource){ + case "formatted-query": + case "generic-query": + case "named-query": + case "nodes-query": + case "linterface": + case "l2-bridge-sbg": + case "l2-bridge-bgf": + case "echo": + case "test": + return true; + } + if(resource.contains(":")) { + resource = resource.substring(0, resource.indexOf(":")); + } + + Set<String> keys = nameValues.keySet(); + for(String key : keys) { + if(!key.contains(".")) { + if("depth".equals(key) || "related-to".equals(key) || "related_to".equals(key)) + continue; + else { + getLogger().warn(String.format("key %s is incompatible with resource type '%s'", key, resource)); + return false; + } + } + } + return true; + } + + public void writeMap(Map<String, Object> properties, String prefix, SvcLogicContext ctx) { + Set<String> mapKeys = properties.keySet(); + + for(String mapKey : mapKeys) { + Object entity = properties.get(mapKey); + if(entity instanceof ArrayList) { + writeList((ArrayList<?>)entity, prefix + "." + mapKey, ctx); + } else + if(entity instanceof String || entity instanceof Long || entity instanceof Integer || entity instanceof Boolean) { + ctx.setAttribute(prefix + "." + mapKey, entity.toString()); + getLogger().debug(prefix + "." + mapKey + " : " + entity.toString()); + } else if(entity instanceof Map) { + String localPrefix = prefix; + if(mapKey != null) { + localPrefix = String.format("%s.%s", prefix, mapKey); + } + writeMap( (Map<String, Object>)entity, localPrefix, ctx); + } + } + } + + private void writeList(ArrayList<?> list, String prefix, SvcLogicContext ctx) { + for(int i = 0; i < list.size(); i++ ) { + Object entity = list.get(i); + if(entity instanceof Map) { + writeMap( (Map<String, Object>)entity, prefix + "[" + i + "]", ctx); + } else + if(entity instanceof String || entity instanceof Long || entity instanceof Integer || entity instanceof Boolean) { + ctx.setAttribute(prefix, entity.toString()); + getLogger().debug(prefix + " : " + entity.toString()); + } + } + + if(list.size() > 0) { + ctx.setAttribute(prefix + "_length", Integer.toString(list.size())); + getLogger().debug(prefix + "_length" + " : " + Integer.toString(list.size())); + } + } + + @Override + public QueryStatus save(String resource, boolean force, boolean localOnly, String key, Map<String, String> params, String prefix, SvcLogicContext ctx) + throws SvcLogicException { + + getLogger().debug("AAIService.save\tresource="+resource); + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + + if(!checkOldFormat(resource, nameValues)) { + ctx.setAttribute(String.format("%s.error.message", prefix), String.format("Resource %s is not supported. Key string contains invaid identifiers", resource)); + return QueryStatus.FAILURE; + } + + if(resource == null || resource.isEmpty() || AAIRequest.createRequest(resource, nameValues) == null) { + getLogger().warn("AAIService.save has unspecified resource"); + ctx.setAttribute(String.format("%s.error.message", prefix), String.format("Resource %s is not supported", resource)); + return QueryStatus.FAILURE; + } + // keys passed + getLogger().debug("key = "+ Arrays.toString(nameValues.entrySet().toArray())); + + // process params + if(params.containsKey("prefix")) { + Map<String, String> tmpParams = ctxGetBeginsWith(ctx, params.get("prefix")); + if(!tmpParams.isEmpty()) { + params.putAll(tmpParams); +// params.remove("prefix"); + } + } + // params passed + getLogger().debug("parms = "+ Arrays.toString(params.entrySet().toArray())); + + boolean useNewModelProcessing = true; + // process server query by name the old way + if(("vserver".equals(resource) || "vserver2".equals(resource))){ + if(nameValues.containsKey("vserver-name")) { + useNewModelProcessing = false; + } + + if(!params.containsKey("vserver-selflink")) { + + AAIRequest request = AAIRequest.createRequest(resource, nameValues); + URL path = null; + try { + request.processRequestPathValues(nameValues); + path = request.getRequestUrl("GET", null); + params.put("vserver-selflink", path.toString()); + } catch (UnsupportedEncodingException | MalformedURLException e) { + // TODO : Fix this + params.put("vserver-selflink", "/vserver"); + } + } + } + + // process data using new model + if(useNewModelProcessing && AAIRequest.createRequest(resource, nameValues) != null) { + + try { + if(!resource.contains(":")){ + return newModelSave(resource, force, key, params, prefix, ctx); + } else { + String[] tokens = resource.split(":"); + String localResource = tokens[0]; + String dependency = tokens[1]; + + AAIDatum instance = newModelObjectRequest( localResource, nameValues, prefix, ctx); + if(instance == null) { + return QueryStatus.NOT_FOUND; + } + + switch(dependency){ + case "relationship-list": + newModelProcessRelationshipList(instance, params, prefix, ctx); + break; + } + // create a method to update relationship-list + AAIRequest request = AAIRequest.createRequest(localResource, nameValues); + request.setRequestObject(instance); + request.processRequestPathValues(nameValues); + + getExecutor().post(request); + getLogger().debug("Save relationship list - returning SUCCESS"); + return QueryStatus.SUCCESS; + } + } catch (Exception exc) { + ctx.setAttribute(prefix + ".error.message", exc.getMessage()); + if(exc instanceof AAIServiceException) { + AAIServiceException aaiexc = (AAIServiceException)exc; + if(aaiexc.getReturnCode() >= 300) { + ctx.setAttribute(prefix + ".error.http.response-code", "" + aaiexc.getReturnCode()); + } + + if(aaiexc.getReturnCode() == 404) { + return QueryStatus.NOT_FOUND; + } + } + getLogger().warn("Failed save() - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + } else { + String reSource = resource.toLowerCase().replace("-", "_"); + String vnfId = null; + + try { + switch(reSource) { + case "generic_vnf": + case "generic-vnf": + vnfId = nameValues.get("vnf_id"); + if(vnfId == null) { + getLogger().debug("Save(generic-vnf) with no vnf-id specified. Returning FAILURE"); + return QueryStatus.FAILURE; + } + vnfId = vnfId.trim().replace("'", "").replace("$", "").replace("'", ""); + GenericVnf vnf = this.requestGenericVnfData(vnfId); + String status = params.get("prov-status"); + boolean updated = false; + if(status != null && !status.isEmpty()) { + vnf.setProvStatus(status); + } + if(updated) { + this.postGenericVnfData(vnfId, vnf); + } + break; + case "vpe": + return update( resource, key, params, prefix, ctx) ; + + default: + getLogger().debug("Save() executing default path - returning FAILURE"); + return QueryStatus.FAILURE; + } + } catch (Exception exc) { + getLogger().warn("Failed save - returning FAILURE", exc); + ctx.setAttribute(prefix + ".error.message", exc.getMessage()); + return QueryStatus.FAILURE; + } + } + + getLogger().debug("Save - returning SUCCESS"); + return QueryStatus.SUCCESS; + } + + @Override + public QueryStatus update(String resource, String key, Map<String, String> params, String prefix, SvcLogicContext ctx) throws SvcLogicException { + + resource = resource.toLowerCase(); + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + getLogger().debug("key = "+ Arrays.toString(nameValues.entrySet().toArray())); + if(!checkOldFormat(resource, nameValues)) { + ctx.setAttribute(String.format("%s.error.message", prefix), String.format("Resource %s is not supported. Key string contains invaid identifiers", resource)); + return QueryStatus.FAILURE; + } + + if(resource == null || resource.isEmpty() || AAIRequest.createRequest(resource, nameValues) == null) { + ctx.setAttribute(String.format("%s.error.message", prefix), String.format("Resource %s is not supported", resource)); + return QueryStatus.FAILURE; + } + + getLogger().debug("parms = "+ Arrays.toString(params.entrySet().toArray())); + + AAIRequest request = AAIRequest.createRequest(resource, nameValues); + request = new UpdateRequest(request, params); + + String[] arguments = request.getArgsList(); + for(String name : arguments) { + String modifiedKey = name.replaceAll("-", "_"); + if(nameValues.containsKey(modifiedKey)) { + String argValue = nameValues.get(modifiedKey); + if(argValue != null) argValue = argValue.trim().replace("'", "").replace("$", "").replace("'", ""); + request.addRequestProperty(name, argValue); + } + } + + try { + QueryStatus retval = QueryStatus.SUCCESS; + + retval = newModelQuery(resource, false, null, key, "tmpDelete", null, ctx); + + if(retval == null || retval != QueryStatus.SUCCESS) { + return retval; + } + + String resourceVersion = ctx.getAttribute("tmpDelete.resource-version"); + if(resourceVersion == null) { + return QueryStatus.NOT_FOUND; + } + params.put("resource-version", resourceVersion); + + request.processRequestPathValues(nameValues); + getExecutor().patch(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + if(aaiexc.getReturnCode() == 404) + return QueryStatus.NOT_FOUND; + else + return QueryStatus.FAILURE; + } catch (Exception exc) { + getLogger().warn("Failed update - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + + getLogger().debug("Update - returning SUCCESS"); + return QueryStatus.SUCCESS; + } + + @Override + public QueryStatus delete(String resource, String key, SvcLogicContext ctx) throws SvcLogicException { + getLogger().debug("AAIService.delete\tresource="+resource); + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + getLogger().debug("key = "+ Arrays.toString(nameValues.entrySet().toArray())); + + if(!checkOldFormat(resource, nameValues)) { + ctx.setAttribute(String.format("%s.error.message", "aaiData"), String.format("Resource %s is not supported. Key string contains invaid identifiers", resource)); + return QueryStatus.FAILURE; + } + + if(resource == null || resource.isEmpty() || AAIRequest.createRequest(resource, nameValues) == null) { + ctx.setAttribute(String.format("%s.error.message", "tmpDelete"), String.format("Resource %s is not supported", resource)); + return QueryStatus.FAILURE; + } + + if(AAIRequest.createRequest(resource, nameValues) != null) { + if(resource.contains(":")) { + return processDeleteRelationshipList(resource, key, ctx, nameValues); + } + + + try { + QueryStatus retval = QueryStatus.SUCCESS; + + retval = newModelQuery(resource, false, null, key, "tmpDelete", null, ctx); + + if(retval == null || retval != QueryStatus.SUCCESS) { + return retval; + } + + String resourceVersion = ctx.getAttribute("tmpDelete.resource-version"); + if(resourceVersion == null) { + return QueryStatus.NOT_FOUND; + } + + try { + AAIRequest request = AAIRequest.createRequest(resource, nameValues); + if(request == null) { + return QueryStatus.FAILURE; + } + + request.processRequestPathValues(nameValues); + + if(getExecutor().delete(request, resourceVersion)) { + return QueryStatus.SUCCESS; + } + } catch(AAIServiceException aaiexc) { + if(aaiexc.getReturnCode() == 404) + return QueryStatus.NOT_FOUND; + else + return QueryStatus.FAILURE; + + } catch (Exception exc) { + getLogger().warn("requestGenericVnfData", exc); + return QueryStatus.FAILURE; + } + + } catch (Exception exc) { + getLogger().warn("Failed delete - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + } else { + String resoourceName = resource; + String identifier = null; + + if(resoourceName == null) + return QueryStatus.FAILURE; + + if(resoourceName.contains(":")) { + String[] tokens = resoourceName.split(":"); + if(tokens != null && tokens.length > 0) { + resoourceName = tokens[0]; + identifier = tokens[1]; + } + } + if("relationship-list".equals(identifier) || "relationshipList".equals(identifier)) { +// RelationshipRequest relationshipRequest = new RelationshipRequest(); + if("generic-vnf".equals(resoourceName)){ + String vnfId = nameValues.get("vnf_id"); + String relatedTo = nameValues.get("related_to"); + vnfId = vnfId.trim().replace("'", "").replace("$", "").replace("'", ""); + relatedTo = relatedTo.trim().replace("'", "").replace("$", "").replace("'", ""); + + GenericVnf vnf; + try { + vnf = this.requestGenericVnfData(vnfId); + if(vnf == null) + return QueryStatus.NOT_FOUND; + } catch (AAIServiceException exc) { + getLogger().warn("Failed delete - returning NOT_FOUND", exc); + return QueryStatus.NOT_FOUND; + } + boolean itemRemoved = false; + RelationshipList relationshipList = vnf.getRelationshipList(); + List<Relationship> relationships = relationshipList.getRelationship(); + List<Relationship> iterableList = new LinkedList<Relationship>(relationships); + for(Relationship relationship : iterableList) { + if(relationship.getRelatedTo().equals(relatedTo)) { + relationships.remove(relationship); + itemRemoved = true; + } + } + + if(!itemRemoved) + return QueryStatus.NOT_FOUND; + +// AAIRequest masterRequest = new GenericVnfRequest(); +// masterRequest.addRequestProperty(GenericVnfRequest.VNF_ID, vnfId); +// relationshipRequest.addMasterRequest(masterRequest); +// Map<String, String> attributes = objectToProperties(vnf); +// try { +// Boolean result = getExecutor().delete(relationshipRequest, attributes.get(AAIRequest.RESOURCE_VERSION)); +// } catch (AAIServiceException e) { +// return QueryStatus.FAILURE; +// } + + try { + this.postGenericVnfData(vnf.getVnfId(), vnf); + } catch (AAIServiceException exc) { + if(exc.getReturnCode() == 404){ + return QueryStatus.NOT_FOUND; + } else { + getLogger().warn("Failed delete - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + } + return QueryStatus.SUCCESS; + } + } + } + return QueryStatus.FAILURE; + } + + @Override + public QueryStatus exists(String resource, String key, String prefix, SvcLogicContext ctx) throws SvcLogicException { + return query(resource, false, null, key, prefix, null, ctx); + } + + @Override + public QueryStatus isAvailable(String arg0, String arg1, String arg2, SvcLogicContext arg3) + throws SvcLogicException { + // TODO Auto-generated method stub + throw new SvcLogicException("Method AAIService.isAvailable() has not been implemented yet"); + } + + @Override + public QueryStatus notify(String resource, String action, String key, SvcLogicContext ctx) throws SvcLogicException { + // TODO Auto-generated method stub + throw new SvcLogicException("Method AAIService.notify() has not been implemented yet"); + } + +// @Override + public QueryStatus newModelQuery(String resource, boolean localOnly, String select, String key, String prefix, String orderBy, SvcLogicContext ctx) { + + Object response = null; + QueryStatus retval = QueryStatus.SUCCESS; + String modifier = null; + + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + if(resource.contains(":")) { + modifier = resource.split(":")[1]; + } + + try { + AAIRequest request = AAIRequest.createRequest(resource, nameValues); + if(request == null) { + return QueryStatus.FAILURE; + } + + Map<String, String> params = new HashMap<String, String>(); + + request.processRequestPathValues(nameValues); + if(nameValues.containsKey("prefix")){ + Map<String, String> tmpParams = ctxGetBeginsWith(ctx, nameValues.get("prefix")); + if(!tmpParams.isEmpty()) { + params.putAll(tmpParams); + } + if("named-query".equals(resource)) + request.setRequestObject(extractNamedQueryDataFromQueryPrefix(nameValues, params)); + } + String rv = getExecutor().get(request); + + retval = processResponseData(rv, resource, request, prefix, ctx, nameValues, modifier); + + } catch(AAIServiceException aaiexc) { + int errorCode = aaiexc.getReturnCode(); + ctx.setAttribute(prefix + ".error.message", aaiexc.getMessage()); + if(errorCode >= 300) { + ctx.setAttribute(prefix + ".error.http.response-code", "" + aaiexc.getReturnCode()); + } + + if(aaiexc.getReturnCode() == 404) + return QueryStatus.NOT_FOUND; + + return QueryStatus.FAILURE; + } catch (Exception exc) { + getLogger().warn("requestGenericVnfData", exc); + ctx.setAttribute(prefix + ".error.message", exc.getMessage()); + return QueryStatus.FAILURE; + } + + return retval; + } + + public QueryStatus processResponseData(String rv, String resource, AAIRequest request, String prefix, SvcLogicContext ctx, HashMap<String, String> nameValues, String modifier) throws JsonParseException, JsonMappingException, IOException, AAIServiceException + { + Object response = null; + + if(rv == null) { + return QueryStatus.NOT_FOUND; + } + + response = request.jsonStringToObject(rv); + if(response == null) { + return QueryStatus.NOT_FOUND; + } + + if("generic-query".equals(resource)) { + SearchResults rd = SearchResults.class.cast(response); + List<ResultData> rdList = rd.getResultData(); + if(rdList == null || rdList.isEmpty()) { + return QueryStatus.NOT_FOUND; + } + ResultData rDatum = rdList.get(0); + nameValues.put("selflink", rDatum.getResourceLink()); + AAIRequest req2 = AAIRequest.createRequest(rDatum.getResourceType(), nameValues); + req2.processRequestPathValues(nameValues); + rv = getExecutor().get(req2); + if(rv == null) { + return QueryStatus.NOT_FOUND; + } + + response = req2.jsonStringToObject(rv); + if(response == null) { + return QueryStatus.NOT_FOUND; + } + } + + if("named-query".equals(resource)) { + InventoryResponseItems rd = InventoryResponseItems.class.cast(response); + List<InventoryResponseItem> iRIlist = rd.getInventoryResponseItem(); + if(iRIlist == null || iRIlist.isEmpty()) { + return QueryStatus.NOT_FOUND; + } + } + + if("nodes-query".equals(resource)) { + SearchResults rd = SearchResults.class.cast(response); + List<ResultData> rdList = rd.getResultData(); + if(rdList == null || rdList.isEmpty()) { + return QueryStatus.NOT_FOUND; + } + ResultData rDatum = rdList.get(0); + response = rDatum; + } + + if("formatted-query".equals(resource)) { + FormattedQueryResultList rd = FormattedQueryResultList.class.cast(response); + List<Results> iRIlist = rd.getResults(); + if(iRIlist == null || iRIlist.isEmpty()) { + return QueryStatus.NOT_FOUND; + } + } + + String preFix = null; + if(prefix == null || prefix.isEmpty()) { + preFix = ""; + } else { + preFix = prefix + "."; + } + + Map<String,Object> props = objectToProperties(response); + Set<String> keys = props.keySet(); + for(String theKey: keys) { + if(getLogger().isTraceEnabled()) + getLogger().trace(theKey); + + Object value = props.get(theKey); + if(value == null) + continue; + Object type = value.getClass(); + if(value instanceof String) { + ctx.setAttribute(preFix + theKey, value.toString()); + continue; + } + if(value instanceof Boolean) { + ctx.setAttribute(preFix + theKey, value.toString()); + continue; + } + if(value instanceof Integer) { + ctx.setAttribute(preFix + theKey, value.toString()); + continue; + } + if(value instanceof Long) { + ctx.setAttribute(preFix + theKey, value.toString()); + continue; + } + + if(value instanceof ArrayList) { + ArrayList<?> array = ArrayList.class.cast(value); + for(int i = 0; i < array.size(); i++) { +// ctx.setAttribute(String.format("%s%s[%d]", preFix, theKey, i), array.get(i).toString()); + writeList(array, String.format("%s.%s", prefix, theKey), ctx); + } + continue; + } + + if("relationship-list".equals(theKey)){ + Map<String, Object> relationshipList = (Map<String, Object>)value; + // we are interested in seeing just the selected relationship + if(theKey.equals(modifier)) { + List<?> relationships = (List<?>)relationshipList.get("relationship"); + if(relationships != null && !relationships.isEmpty()) { + + List newRelationships = new LinkedList(); + newRelationships.addAll(relationships); + + for(Object obj : newRelationships){ + if(obj instanceof Map<?, ?>) { + Map<?, ?> relProperties = (Map<?, ?>)obj; + if(relProperties.containsKey("related-to")) { + Object relPropsRelatedTo = relProperties.get("related-to"); + + String relatedTo = nameValues.get("related_to"); + if(relatedTo != null) { + relatedTo = relatedTo.trim().replace("'", "").replace("$", "").replace("'", ""); + if(!relatedTo.equals(relPropsRelatedTo)) { + relationships.remove(relProperties); + } + continue; + } else { + continue; + } + } + } + } + } + } + writeMap(relationshipList, String.format("%s.%s", prefix, theKey), ctx); + continue; + } + + if(value instanceof Map) { + Map<String, Object> subnetsList = (Map<String, Object>)value; + writeMap(subnetsList, String.format("%s.%s", prefix, theKey), ctx); + continue; + } + + } + return QueryStatus.SUCCESS; + } + + + public QueryStatus newModelBackupRequest(String resource, Map<String, String> params, String prefix, SvcLogicContext ctx) { + + QueryStatus retval = QueryStatus.SUCCESS; + HashMap<String, String> nameValues = new HashMap<String, String>(); + + try { + AAIRequest request = AAIRequest.createRequest(resource, nameValues); + if(request == null) { + return QueryStatus.FAILURE; + } + + boolean argsFound = false; + String[] arguments = request.getArgsList(); + for(String name : arguments) { + String tmpName = name.replaceAll("-", "_"); + String value = params.get(tmpName); + if(value != null && !value.isEmpty()) { + value = value.trim().replace("'", "").replace("$", "").replace("'", ""); + request.addRequestProperty(name, value); + argsFound = true; + } + } + if(!argsFound) { + getLogger().warn("No arguments were found. Terminating backup request."); + return QueryStatus.FAILURE; + } + + String rv = getExecutor().get(request); + ctx.setAttribute(prefix, rv); + } catch(AAIServiceException aaiexc) { + if(aaiexc.getReturnCode() == 404) + return QueryStatus.NOT_FOUND; + + return QueryStatus.FAILURE; + } catch (Exception exc) { + getLogger().warn("newModelBackupRequest", exc); + return QueryStatus.FAILURE; + } + + return retval; + } + + public AAIDatum newModelObjectRequest(String resource, Map<String, String> params, String prefix, SvcLogicContext ctx) + throws AAIServiceException { + + AAIDatum response = null; + + try { + AAIRequest request = AAIRequest.createRequest(resource, params); + if(request == null) { + return null; + } + + request.processRequestPathValues(params); + String rv = getExecutor().get(request); + response = request.jsonStringToObject(rv); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + getLogger().warn("newModelBackupRequest", exc); + throw new AAIServiceException(exc); + } + + return response; + } + + + @Override + public QueryStatus release(String arg0, String arg1, SvcLogicContext arg2) throws SvcLogicException { + // TODO Auto-generated method stub + throw new SvcLogicException("Method AAIService.release() has not been implemented yet"); + } + + @Override + public QueryStatus reserve(String arg0, String arg1, String arg2, String arg3, SvcLogicContext arg4) + throws SvcLogicException { + // TODO Auto-generated method stub + throw new SvcLogicException("Method AAIService.reserve() has not been implemented yet"); + } + + private QueryStatus newModelSave(String resource, boolean force, String key, Map<String, String> parms, String prefix, SvcLogicContext ctx) { + getLogger().debug("Executing newModelSave for resource : " + resource); + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + + try { + ArrayList<String> subResources = new ArrayList<String>(); + Set<String> set = parms.keySet(); + Map<String, Method> setters = new HashMap<String, Method>(); + Map<String, Method> getters = new HashMap<String, Method>(); + + // 1. find class + AAIRequest request = AAIRequest.createRequest(resource, nameValues); + Class<? extends AAIDatum> resourceClass = request.getModelClass(); + getLogger().debug(resourceClass.getName()); + AAIDatum instance = resourceClass.newInstance(); + + { + Annotation[] annotations = resourceClass.getAnnotations(); + for(Annotation annotation : annotations) { + Class<? extends Annotation> anotationType = annotation.annotationType(); + String annotationName = anotationType.getName(); +// if("com.fasterxml.jackson.annotation.JsonPropertyOrder".equals(annotationName)){ + + // 2. find string property setters and getters for the lists + if("javax.xml.bind.annotation.XmlType".equals(annotationName)){ + XmlType order = (XmlType)annotation; + String[] values = order.propOrder(); + for(String value : values) { + String id = camelCaseToDashedString(value); + Field field = resourceClass.getDeclaredField(value); + Class<?> type = field.getType(); + Method setter = null; + try { + setter = resourceClass.getMethod("set"+StringUtils.capitalize(value), type); + if(type.getName().startsWith("java.lang") || "boolean".equals(type.getName()) || "long".equals(type.getName())) { + try { + setter.setAccessible(true); + Object arglist[] = new Object[1]; + arglist[0] = parms.get(id); + + if(arglist[0] != null) { + if(!type.getName().equals("java.lang.String")) { +// getLogger().debug(String.format("Processing %s with parameter %s", types[0].getName(), value)); + if("boolean".equals(type.getName())) { + arglist[0] = valueOf(Boolean.class, parms.get(id)); + } else if("long".equals(type.getName())) { + arglist[0] = valueOf(Long.class, parms.get(id)); + } else { + arglist[0] = valueOf(type, parms.get(id)); + } + } + Object o = setter.invoke(instance, arglist); + } + set.remove(id); + + } catch (Exception x) { + Throwable cause = x.getCause(); + getLogger().warn("Failed process for " + resourceClass.getName(), x); + } + } else if(type.getName().equals("java.util.List")) { + List<String> newValues = new ArrayList<String>(); + String length = id+"_length"; + if(!parms.isEmpty() && parms.containsKey(length)) { + String tmp = parms.get(length).toString(); + int count = Integer.valueOf(tmp); + for(int i=0; i<count; i++) { + String tmpValue = parms.get(String.format("%s[%d]", id, i)); + newValues.add(tmpValue); + } + if(!newValues.isEmpty()) { + Object o = setter.invoke(instance, newValues); + } + } + set.remove(id); + } else { + setters.put(id, setter); + } + } catch(Exception exc) { + + } + + Method getter = null; + try { + getter = resourceClass.getMethod("get"+StringUtils.capitalize(value)); + if(!type.getName().equals("java.lang.String")) { + getters.put(id, getter); + } + } catch(Exception exc) { + + } + + } + subResources.addAll(Arrays.asList(values)); + } + } + } + + // remove getters that have matching setter + for(String setKey : setters.keySet()) { + if(getters.containsKey(setKey)) { + getters.remove(setKey); + } + } + + Set<String> relationshipKeys = new TreeSet<String>(); + Set<String> vlansKeys = new TreeSet<String>(); + Set<String> metadataKeys = new TreeSet<String>(); + + for(String attribute : set) { + String value = parms.get(attribute); + if(attribute.startsWith("relationship-list")) { + relationshipKeys.add(attribute); + } else if(attribute.startsWith("vlans")) { + vlansKeys.add(attribute); + } else if(attribute.startsWith("metadata")) { + metadataKeys.add(attribute); + } + } + // 3. find list property getters + for(String attribute : set) { + String value = parms.get(attribute); + Method method = getters.get(attribute); + if(method != null) { + try { + method.setAccessible(true); + Object arglist[] = new Object[0]; +// arglist[0] = value; + Class<?>[] types = method.getParameterTypes(); + if(types.length == 0){ + Object o = method.invoke(instance, arglist); + if(o instanceof ArrayList) { + ArrayList<String> values = (ArrayList<String>)o; +// getLogger().debug(String.format("Processing %s with parameter %s", types[0].getName(), value)); + value = value.replace("[", "").replace("]", ""); + List<String> items = Arrays.asList(value.split("\\s*,\\s*")); + for(String s : items) { + values.add(s.trim()); + } + } + } + } catch (Exception x) { + Throwable cause = x.getCause(); + getLogger().warn("Failed process for " + resourceClass.getName(), x); + } + } + } + // 4. Process Relationships + // add relationship list + if( (subResources.contains("relationship-list") || subResources.contains("relationshipList")) && !relationshipKeys.isEmpty()) { + RelationshipList relationshipList = null; + Object obj = null; + Method getRelationshipListMethod = resourceClass.getMethod("getRelationshipList"); + if(getRelationshipListMethod != null){ + try { + getRelationshipListMethod.setAccessible(true); + obj = getRelationshipListMethod.invoke(instance); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + if(obj != null && obj instanceof RelationshipList){ + relationshipList = (RelationshipList)obj; + } else { + relationshipList = new RelationshipList(); + Method setRelationshipListMethod = resourceClass.getMethod("setRelationshipList", RelationshipList.class); + if(setRelationshipListMethod != null){ + try { + setRelationshipListMethod.setAccessible(true); + Object arglist[] = new Object[1]; + arglist[0] = relationshipList; + + obj = setRelationshipListMethod.invoke(instance, arglist); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + } + + List<Relationship> relationships = relationshipList.getRelationship(); + + int i = 0; + while(true){ + int j = 0; + String searchKey = "relationship-list.relationship[" + i + "].related-to"; + if(!parms.containsKey(searchKey)) + break; + Relationship relationship = new Relationship(); + relationships.add(relationship); + + String relatedTo = parms.get(searchKey); + relationship.setRelatedTo(relatedTo); + + List<RelationshipData> relData = relationship.getRelationshipData(); +// if(relData == null) { +// relData = new LinkedList<RelationshipData>(); +// relationship.setRelationshipData(relData); +// } + + while(true) { + String searchRelationshipKey = "relationship-list.relationship[" + i + "].relationship-data[" + j + "].relationship-key"; + String searchRelationshipValue = "relationship-list.relationship[" + i + "].relationship-data[" + j + "].relationship-value"; + if(!parms.containsKey(searchRelationshipKey)) + break; + + RelationshipData relDatum = new RelationshipData(); + relDatum.setRelationshipKey(parms.get(searchRelationshipKey)); + relDatum.setRelationshipValue(parms.get(searchRelationshipValue)); + relData.add(relDatum); + j++; + } + + i++; + } + } + + // 4. vlans + if(subResources.contains("vlans") && !vlansKeys.isEmpty()) { + Object obj = null; + Vlans vlanList = null; + Method getVLansMethod = resourceClass.getMethod("getVlans"); + if(getVLansMethod != null){ + try { + getVLansMethod.setAccessible(true); + obj = getVLansMethod.invoke(instance); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + if(obj != null && obj instanceof Vlans){ + vlanList = (Vlans)obj; + } else { + vlanList = new Vlans(); + Method setVlansMethod = resourceClass.getMethod("setVlans", Vlans.class); + if(setVlansMethod != null){ + try { + setVlansMethod.setAccessible(true); + Object arglist[] = new Object[1]; + arglist[0] = vlanList; + + obj = setVlansMethod.invoke(instance, arglist); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + } + + int i = 0; + while(true){ + String searchKey = "vlans.vlan[" + i + "].vlan-interface"; + if(!parms.containsKey(searchKey)) + break; + + String vlanInterface = parms.get("vlans.vlan[" + i + "].vlan-interface"); + String vlanIdInner = parms.get("vlans.vlan[" + i + "].vlan-id-inner"); + String vlanIdOute = parms.get("vlans.vlan[" + i + "].vlan-id-outer"); + String speedValue = parms.get("vlans.vlan[" + i + "].speed-value"); + String speedUnits = parms.get("vlans.vlan[" + i + "].speed-units"); + + Vlan vlan = new Vlan(); + vlan.setVlanInterface(vlanInterface); + + if(vlanIdInner != null) { + Long iVlanIdInner = Long.parseLong(vlanIdInner); + vlan.setVlanIdInner(iVlanIdInner); + } + + if(vlanIdOute != null) { + Long iVlanIdOuter = Long.parseLong(vlanIdOute); + vlan.setVlanIdOuter(iVlanIdOuter); + } + + if(speedValue != null) { + vlan.setSpeedValue(speedValue); + vlan.setSpeedUnits(speedUnits); + } + + vlanList.getVlan().add(vlan); + i++; + } + } + + // 5. metadata + if(subResources.contains("metadata") && !metadataKeys.isEmpty()) { + Object obj = null; + Metadata metadataList = null; + Method getMetadataMethod = resourceClass.getMethod("getMetadata"); + if(getMetadataMethod != null){ + try { + getMetadataMethod.setAccessible(true); + obj = getMetadataMethod.invoke(instance); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + if(obj != null && obj instanceof Metadata){ + metadataList = (Metadata)obj; + } else { + metadataList = new Metadata(); + Method setMetadataMethod = resourceClass.getMethod("setMetadata", Metadata.class); + if(setMetadataMethod != null){ + try { + setMetadataMethod.setAccessible(true); + Object arglist[] = new Object[1]; + arglist[0] = metadataList; + + obj = setMetadataMethod.invoke(instance, arglist); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + } + + if(metadataList.getMetadatum() == null) { +// metadataList.setMetadatum(new ArrayList<Metadatum>()); + } + + // process data + int i = 0; + while(true){ + String metaKey = "metadata.metadatum[" + i + "].meta-key"; + if(!parms.containsKey(metaKey)) + break; + + String metaValue = parms.get("metadata.metadatum[" + i + "].meta-value"); + + Metadatum vlan = new Metadatum(); + vlan.setMetaname(metaKey); + vlan.setMetaval(metaValue); + + metadataList.getMetadatum().add(vlan); + i++; + } + + } + + + // 6. Prepare AAI request + String[] args = request.getArgsList(); + for(String arg : args) { + String modifiedKey = arg.replaceAll("-", "_"); + if(nameValues.containsKey(modifiedKey)) { + String argValue = nameValues.get(modifiedKey); + if(argValue != null) argValue = argValue.trim().replace("'", "").replace("$", "").replace("'", ""); + request.addRequestProperty(arg, argValue); + } + } + + request.processRequestPathValues(nameValues); + request.setRequestObject(instance); + Object response = getExecutor().post(request); + if(request.expectsDataFromPUTRequest()){ + if(response != null && response instanceof String) { + String rv = response.toString(); + QueryStatus retval = processResponseData(rv, resource, request, prefix, ctx, nameValues, null); + getLogger().debug("newModelSave - returning " + retval.toString()); + return retval; + } + } + + } catch(AAIServiceException exc){ + ctx.setAttribute(prefix + ".error.message", exc.getMessage()); + int returnCode = exc.getReturnCode(); + if(returnCode >= 300) { + ctx.setAttribute(prefix + ".error.http.response-code", "" + exc.getReturnCode()); + } + + if(returnCode == 400 || returnCode == 412) + return QueryStatus.FAILURE; + else if(returnCode == 404) + return QueryStatus.NOT_FOUND; + else { + getLogger().warn("Failed newModelSave - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + } catch(Exception exc){ + getLogger().warn("Failed newModelSave - returning FAILURE", exc); + ctx.setAttribute(prefix + ".error.message", exc.getMessage()); + return QueryStatus.FAILURE; + } + + getLogger().debug("newModelSave - returning SUCCESS"); + return QueryStatus.SUCCESS; + } + + private static final String regex = "([A-Z][a-z,0-9]+)"; + private static final String replacement = "-$1"; + + private String camelCaseToDashedString(String propOrder) { + return propOrder.replaceAll(regex, replacement).toLowerCase(); + } + + private QueryStatus newModelProcessRelationshipList(Object instance, Map<String, String> params, String prefix, SvcLogicContext ctx) throws Exception { + + Class resourceClass = instance.getClass(); + + Set<String> relationshipKeys = new TreeSet<String>(); + + Set<String> set = params.keySet(); + + for(String attribute : set) { + String value = params.get(attribute); + + if(attribute.startsWith("relationship-list")) { + relationshipKeys.add(attribute); + } + } + + // 3. Process Relationships + // add relationship list + if(!relationshipKeys.isEmpty()) { + RelationshipList relationshipList = null; + Object obj = null; + Method getRelationshipListMethod = resourceClass.getMethod("getRelationshipList"); + if(getRelationshipListMethod != null){ + try { + getRelationshipListMethod.setAccessible(true); + obj = getRelationshipListMethod.invoke(instance); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + if(obj != null && obj instanceof RelationshipList){ + relationshipList = (RelationshipList)obj; + } else { + relationshipList = new RelationshipList(); + Method setRelationshipListMethod = resourceClass.getMethod("setRelationshipList", RelationshipList.class); + if(setRelationshipListMethod != null){ + try { + setRelationshipListMethod.setAccessible(true); + Object arglist[] = new Object[1]; + arglist[0] = relationshipList; + + obj = setRelationshipListMethod.invoke(instance, arglist); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + } + + boolean createdNewRelationships = false; + List<Relationship> relationships = relationshipList.getRelationship(); + if(relationships == null) { + relationships = new ArrayList<Relationship>(); + createdNewRelationships = true; + } + + int i = 0; + int j = 0; + while(true){ + String searchKey = "relationship-list.relationship[" + i + "].related-to"; + if(!params.containsKey(searchKey)) + break; + + j = 0; + String relatedTo = params.get(searchKey); + String relatedLinkKey = "relationship-list.relationship[" + i + "].related-link"; + String relatedLink = null; + if(params.containsKey(relatedLinkKey)) { + relatedLink = params.get(relatedLinkKey); + } + + Relationship relationship = new Relationship(); + relationships.add(relationship); + relationship.setRelatedTo(relatedTo); + if(relatedLink != null) { + relationship.setRelatedLink(relatedLink); + } else { + List<RelationshipData> relData = relationship.getRelationshipData(); + + while(true) { + String searchRelationshipKey = "relationship-list.relationship[" + i + "].relationship-data[" + j + "].relationship-key"; + String searchRelationshipValue = "relationship-list.relationship[" + i + "].relationship-data[" + j + "].relationship-value"; + if(!params.containsKey(searchRelationshipKey)) + break; + + RelationshipData relDatum = new RelationshipData(); + relDatum.setRelationshipKey(params.get(searchRelationshipKey)); + relDatum.setRelationshipValue(params.get(searchRelationshipValue)); + relData.add(relDatum); + j++; + } + } + + + i++; + } + } + + return QueryStatus.SUCCESS; + } + + private Relationship findRelationship(List<Relationship> relationships, String relatedTo) { + if(relatedTo == null) + return null; + + for(Relationship relationship : relationships) { + if(relationship.getRelatedTo().equals(relatedTo)){ + return relationship; + } + } + return null; + } + + protected HashMap<String,String> keyToHashMap(String key, SvcLogicContext ctx) { + if (key == null) { + return (null); + } + + getLogger().debug("Converting key [" + key + "] to where clause"); + + if (key.startsWith("'") && key.endsWith("'")) { + key = key.substring(1, key.length() - 1); + + getLogger().debug("Stripped outer single quotes - key is now [" + key + "]"); + } + + String[] keyTerms = key.split("\\s+"); + + StringBuffer whereBuff = new StringBuffer(); + String term1 = null; + String op = null; + String term2 = null; + HashMap<String, String> results = new HashMap<String, String>(); + + for (int i = 0; i < keyTerms.length; i++) { + if (term1 == null) { + if ("and".equalsIgnoreCase(keyTerms[i]) + || "or".equalsIgnoreCase(keyTerms[i])) { + // Skip over ADD/OR + } else { + term1 = resolveTerm(keyTerms[i], ctx); + } + } else if (op == null) { + if ("==".equals(keyTerms[i])) { + op = "="; + } else { + op = keyTerms[i]; + } + } else { + term2 = resolveTerm(keyTerms[i], ctx); + term2 = term2.trim().replace("'", "").replace("$", "").replace("'", ""); + results.put(term1, term2); + + term1 = null; + op = null; + term2 = null; + } + } + + return (results); + } + + private String resolveTerm(String term, SvcLogicContext ctx) { + if (term == null) { + return (null); + } + + getLogger().debug("resolveTerm: term is " + term); + + if (term.startsWith("$") && (ctx != null)) { + // Resolve any index variables. + + return ("'" + resolveCtxVariable(term.substring(1), ctx) + "'"); + } else if (term.startsWith("'") || term.startsWith("\"")) { + return (term); + } else { + return (term.replaceAll("-", "_")); + + } + + } + + private String resolveCtxVariable(String ctxVarName, SvcLogicContext ctx) { + + if (ctxVarName.indexOf('[') == -1) { + // Ctx variable contains no arrays + return (ctx.getAttribute(ctxVarName)); + } + + // Resolve any array references + StringBuffer sbuff = new StringBuffer(); + String[] ctxVarParts = ctxVarName.split("\\["); + sbuff.append(ctxVarParts[0]); + for (int i = 1; i < ctxVarParts.length; i++) { + if (ctxVarParts[i].startsWith("$")) { + int endBracketLoc = ctxVarParts[i].indexOf("]"); + if (endBracketLoc == -1) { + // Missing end bracket ... give up parsing + getLogger().warn("Variable reference " + ctxVarName + + " seems to be missing a ']'"); + return (ctx.getAttribute(ctxVarName)); + } + + String idxVarName = ctxVarParts[i].substring(1, endBracketLoc); + String remainder = ctxVarParts[i].substring(endBracketLoc); + + sbuff.append("["); + sbuff.append(ctx.getAttribute(idxVarName)); + sbuff.append(remainder); + + } else { + // Index is not a variable reference + sbuff.append("["); + sbuff.append(ctxVarParts[i]); + } + } + + return (ctx.getAttribute(sbuff.toString())); + } + + + public QueryStatus backup(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException { + String resource = params.get("resource").toLowerCase(); + String prefix = params.get("data-key"); + + HashMap<String, String> nameValues = new HashMap<String, String>(); + if(AAIRequest.createRequest(resource, nameValues) != null) { + + try { + return newModelBackupRequest(resource, params, prefix, ctx); + } catch (Exception exc) { + getLogger().warn("Failed backup - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + } + + return QueryStatus.NOT_FOUND; + } + + @Override + public QueryStatus restore(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException { + + QueryStatus retval = QueryStatus.SUCCESS; + String resource = params.get("resource").toLowerCase(); + String prefix = params.get("data-key"); + + HashMap<String, String> nameValues = new HashMap<String, String>(); + if(AAIRequest.createRequest(resource, nameValues) != null) { + + try { + retval = newModelBackupRequest(resource, params, "tmpRestore", ctx); + if(retval == QueryStatus.SUCCESS) { + String current_json = ctx.getAttribute("tmpRestore"); + ctx. setAttribute("tmpRestore", null); + + String snapshot_json = ctx.getAttribute(prefix); + } + } catch (Exception exc) { + getLogger().warn("Failed restore - returning FAILURE", exc); + return QueryStatus.FAILURE; + } + } + + return QueryStatus.NOT_FOUND; + } + + protected Map<String, Object> objectToProperties(Object object) { + ObjectMapper mapper = AAIService.getObjectMapper(); + return mapper.convertValue(object, Map.class); + } + + static <T> T valueOf(Class<T> klazz, String arg) { + Exception cause = null; + T ret = null; + try { + ret = klazz.cast(klazz.getDeclaredMethod("valueOf", String.class).invoke(null, arg)); + } catch (NoSuchMethodException exc) { + LoggerFactory.getLogger(AAIService.class).warn("Wrong data type", exc); + ret = klazz.cast(arg); + } catch (IllegalAccessException e) { + cause = e; + } catch (InvocationTargetException e) { + cause = e; + } + if (cause == null) { + return ret; + } else { + throw new IllegalArgumentException(cause); + } + } + + private QueryStatus processDeleteRelationshipList(String resource, String key, SvcLogicContext ctx, HashMap<String, String> nameValues) { + try { + AAIRequest request = AAIRequest.createRequest(resource, nameValues); + if(request == null) { + return QueryStatus.FAILURE; + } + + request.processRequestPathValues(nameValues); + URL url = request.getRequestUrl("GET", null); + + Class resourceClass = request.getModelClass(); + Object instance = getResource(url.toString(), resourceClass); + if(instance == null) + return QueryStatus.NOT_FOUND; + + // get resource version + String resourceVersion = null; + Method getResourceVersionMethod = resourceClass.getMethod("getResourceVersion"); + if(getResourceVersionMethod != null){ + try { + getResourceVersionMethod.setAccessible(true); + Object object = getResourceVersionMethod.invoke(instance); + if(object != null) + resourceVersion = object.toString(); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + + RelationshipList relationshipList = null; + Object obj = null; + Method getRelationshipListMethod = resourceClass.getMethod("getRelationshipList"); + if(getRelationshipListMethod != null){ + try { + getRelationshipListMethod.setAccessible(true); + obj = getRelationshipListMethod.invoke(instance); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + if(obj != null && obj instanceof RelationshipList){ + relationshipList = (RelationshipList)obj; + } else { + getLogger().debug("No relationships found to process."); + return QueryStatus.NOT_FOUND; + } + + if(relationshipList.getRelationship() == null || relationshipList.getRelationship().isEmpty()) { + return QueryStatus.NOT_FOUND; + } + String relatedTo = nameValues.get("related_to"); + if(relatedTo == null) { + return QueryStatus.FAILURE; + } + + relatedTo = relatedTo.replaceAll("_", "-"); + + String relatedLink = nameValues.get("relationship.related_link"); + if(relatedLink != null) { + relatedLink = URLDecoder.decode(relatedLink, "UTF-8"); + } + + List<Relationship> relationships = relationshipList.getRelationship(); + List<Relationship> relationshipsToDelete = new LinkedList<Relationship>(); + + for(Relationship relationship : relationships) { + if(relatedTo.equals(relationship.getRelatedTo())) { + if(relatedLink != null) { + if(relationship.getRelatedLink() != null ) { + String localRelatedLink = relationship.getRelatedLink(); + localRelatedLink = URLDecoder.decode(localRelatedLink, "UTF-8"); + if(localRelatedLink.endsWith(relatedLink)) { + getLogger().debug(String.format("Found relationship of '%s' to keyword '%s'", relationship.getRelatedTo(), relatedTo)); + relationshipsToDelete.add(relationship); + } + } + } else { + getLogger().debug(String.format("Found relationship of '%s' to keyword '%s'", relationship.getRelatedTo(), relatedTo)); + relationshipsToDelete.add(relationship); + } + } + } + if(relationshipsToDelete == null || relationshipsToDelete.isEmpty()) { + getLogger().info(String.format("Relationship has not been found for %s", key)); + return QueryStatus.NOT_FOUND; + } + + String path = url.toString(); + path = path + "/relationship-list/relationship"; + URL deleteUrl = new URL(path); + + ObjectMapper mapper = AAIService.getObjectMapper(); + + boolean cumulativeResponse = true; + + for(Relationship targetRelationship : relationshipsToDelete) { + String json_text = mapper.writeValueAsString(targetRelationship); + boolean response = deleteRelationshipList(deleteUrl, json_text); + if(!response) + cumulativeResponse = response; + + } + + if(!cumulativeResponse) + return QueryStatus.FAILURE; + + return QueryStatus.SUCCESS; + + } catch(Exception exc) { + getLogger().warn("processDelete", exc); + return QueryStatus.FAILURE; + } + } + + static final Map<String, String> ctxGetBeginsWith( SvcLogicContext ctx, String prefix ) { + Map<String, String> tmpPrefixMap = new HashMap<String, String>(); + + if(prefix == null || prefix.isEmpty()){ + return tmpPrefixMap; + } + + for( String key : ctx.getAttributeKeySet() ) { + if( key.startsWith(prefix) ) { + String tmpKey = key.substring(prefix.length() + 1); + tmpPrefixMap.put( tmpKey, ctx.getAttribute(key)); + } + } + + Map<String, String> prefixMap = new HashMap<String, String>(); + Pattern p = Pattern.compile(".*\\[\\d\\]"); + + SortedSet<String> keys = new TreeSet(tmpPrefixMap.keySet () ); + for(String key : keys) { + Matcher m = p.matcher(key); + if(m.matches()) { + continue; + } else if(key.endsWith("_length")) { + String listKey = key.substring(0, key.indexOf("_length")); + int max = Integer.parseInt(tmpPrefixMap.get(key)); + + ArrayList<String> data = new ArrayList<String>(); + for(int x = 0; x < max; x++){ + String tmpKey = String.format("%s[%d]", listKey, x); + String tmpValue = tmpPrefixMap.get(tmpKey); + if(tmpValue != null && !tmpValue.isEmpty()) { + data.add(tmpValue); + } + } + if(!data.isEmpty()) { + prefixMap.put(listKey, data.toString()); + } else { + prefixMap.put(key, tmpPrefixMap.get(key)); + } + } else { + prefixMap.put(key, tmpPrefixMap.get(key)); + } + } + + return prefixMap; + } + + /** + */ + protected NamedQueryData extractNamedQueryDataFromQueryPrefix(HashMap<String, String> nameValues, Map<String, String> parms) { + if(parms.isEmpty()) { + return null; + } + + NamedQueryData data = new NamedQueryData(); + + // query parameters + if(data.getQueryParameters() == null) { + data.setQueryParameters(new QueryParameters()); + } + String namedQueryUuid = nameValues.get("named-query-uuid".replaceAll("-", "_")); + if(namedQueryUuid == null) { + namedQueryUuid = parms.get("query-parameters.named-query.named-query-uuid"); + } + NamedQuery namedQuery = new NamedQuery(); + namedQuery.setNamedQueryUuid(namedQueryUuid); + data.getQueryParameters().setNamedQuery(namedQuery); + + // instance filters + if(data.getInstanceFilters() == null) { + data.setInstanceFilters(new InstanceFilters()); + } + + + String quantity = parms.get("instance-filters.instance-filter_length"); + if(quantity != null && StringUtils.isNumeric(quantity)) { + int max = Integer.parseInt(quantity); + for(int i = 0; i < max; i++) { + String keyPattern = String.format("instance-filters.instance-filter[%d].", i); + Set<String> keys = parms.keySet(); + for(String key: keys) { + if(key.startsWith(keyPattern)){ + String value = parms.get(key); + String remainder = key.substring(keyPattern.length()); + String[] split = remainder.split("\\."); + getLogger().debug(String.format("%s", remainder)); + if("logical-link".equals(split[0])) { + InstanceFilter insf = null; + if(data.getInstanceFilters().getInstanceFilter().isEmpty()) { + insf = new InstanceFilter(); + data.getInstanceFilters().getInstanceFilter().add(insf); + } else { + insf = data.getInstanceFilters().getInstanceFilter().get(0); + } + LogicalLink logicalLink = insf.getLogicalLink(); + if(logicalLink == null) { + logicalLink = new LogicalLink(); + insf.setLogicalLink(logicalLink); + } + + switch(split[1]) { + case "link-name": + logicalLink.setLinkName(value); + break; + case "link-type": + logicalLink.setLinkType(value); + break; + case "operational-state": + logicalLink.setOperationalStatus(value); + break; + } + + } else if("pnf".equals(split[0])) { + Pnf pnf = new Pnf(); + pnf.setPnfName(value); + + InstanceFilter insf = new InstanceFilter(); + insf.setPnf(pnf); + data.getInstanceFilters().getInstanceFilter().add(insf); + + } else if("service-instance".equals(split[0])) { + ServiceInstance serviceInstance = new ServiceInstance(); + serviceInstance.setServiceInstanceId(value); + + InstanceFilter insf = new InstanceFilter(); + insf.setServiceInstance(serviceInstance); + data.getInstanceFilters().getInstanceFilter().add(insf); + + } else if("l3-network".equals(split[0])) { + L3Network l3Network = new L3Network(); + if("network-role".equals(split[1])) { + l3Network.setNetworkRole(value); + } + + InstanceFilter insf = new InstanceFilter(); + insf.setL3Network(l3Network); + data.getInstanceFilters().getInstanceFilter().add(insf); + } + } + } + } + } + + return data; + } + + public abstract <T> T getResource(String key, Class<T> type) throws AAIServiceException ; + protected abstract boolean deleteRelationshipList(URL url, String caller) throws AAIServiceException; +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIExecutorInterface.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIExecutorInterface.java new file mode 100644 index 00000000..5b94f258 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIExecutorInterface.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +public interface AAIExecutorInterface { + public Object get(AAIRequest request) throws AAIServiceException; + public Object post(AAIRequest request) throws AAIServiceException; + public Boolean delete(AAIRequest request, String resourceVersion) throws AAIServiceException; + public Object query(AAIRequest request, Class clas) throws AAIServiceException; + public Boolean patch(AAIRequest request, String resourceVersion) throws AAIServiceException; +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIRequest.java new file mode 100644 index 00000000..f806ef4e --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIRequest.java @@ -0,0 +1,420 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Method; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.BitSet; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeSet; + +import org.apache.commons.lang.StringUtils; +import org.openecomp.aai.inventory.v10.GenericVnf; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public abstract class AAIRequest { + protected static final Logger LOG = LoggerFactory.getLogger(AAIRequest.class); + + protected static final String TARGET_URI = "org.openecomp.sdnc.sli.aai.uri"; + + protected static final String MASTER_REQUEST = "master-request"; + + public static final String RESOURCE_VERSION = "resource-version"; + + public static final String DEPTH = "depth"; + + protected static Properties configProperties; + protected final String target_uri; + protected static AAIService aaiService; + + protected AAIDatum requestDatum; + + protected final Properties requestProperties = new Properties(); + + + public static AAIRequest createRequest(String resoourceName, Map<String, String> nameValues){ + + String resoource = resoourceName; + + if(resoource == null) + return null; + + if(resoource.contains(":")) { + String[] tokens = resoource.split(":"); + if(tokens != null && tokens.length > 0) { + resoource = tokens[0]; + } + } + + if(nameValues.containsKey("selflink")){ + Class<? extends AAIDatum> clazz = null; + try { + clazz = getClassFromResource(resoource) ; + } catch (ClassNotFoundException e) { + LOG.warn("AAIRequest does not support class: " + e.getMessage()); + return null; + } + + if(clazz != null) + return new SelfLinkRequest(clazz); + else + return null; + } + + switch(resoource){ + case "generic-query": + return new GenericQueryRequest(); + case "named-query": + return new NamedQueryRequest(); + case "nodes-query": + return new NodesQueryRequest(); + case "custom-query": + return new CustomQueryRequest(); + case "linterface": + return new LInterfaceRequest(LInterfaceRequest.TYPE.L2_BRIDGE_SBG); + case "l2-bridge-sbg": + return new SubInterfaceRequest(SubInterfaceRequest.TYPE.L2_BRIDGE_SBG); + case "l2-bridge-bgf": + return new SubInterfaceRequest(SubInterfaceRequest.TYPE.L2_BRIDGE_BGF); + case "echo": + case "test": + return new EchoRequest(); + + default: + { + AAIRequest request = getRequestFromResource(resoource); + if(request == null) { + return null; + } + return request; + } + } + } + + + /** + * Map containing resource tag to its bit position in bitset mapping + */ + private static Map<String, String> tagValues = new LinkedHashMap<String, String>(); + /** + * Map containing bitset value of the path to its path mapping + */ + private static Map<BitSet, String> bitsetPaths = new LinkedHashMap<BitSet, String>(); + + + public static void setProperties(Properties props, AAIService aaiService) { + AAIRequest.configProperties = props; + AAIRequest.aaiService = aaiService; + + try + { + URL url = null; + Bundle bundle = FrameworkUtil.getBundle(AAIServiceActivator.class); + if(bundle != null) { + BundleContext ctx = bundle.getBundleContext(); + if(ctx == null) + return; + + url = ctx.getBundle().getResource(AAIService.PATH_PROPERTIES); + } else { + url = aaiService.getClass().getResource("/aai-path.properties"); + } + + InputStream in = url.openStream(); + Reader reader = new InputStreamReader(in, "UTF-8"); + + Properties properties = new Properties(); + properties.load(reader); + LOG.info("loaded " + properties.size()); + + Set<String> keys = properties.stringPropertyNames(); + + int index = 0; + Set<String> resourceNames = new TreeSet<String>(); + + for(String key : keys) { + String[] tags = key.split("\\|"); + for(String tag : tags) { + if(!resourceNames.contains(tag)) { + resourceNames.add(tag); + tagValues.put(tag, Integer.toString(++index)); + } + } + BitSet bs = new BitSet(256); + for(String tag : tags) { + String value = tagValues.get(tag); + Integer bitIndex = Integer.parseInt(value) ; + bs.set(bitIndex); + } + String path = properties.getProperty(key); + LOG.info(String.format("bitset %s\t\t%s", bs.toString(), path)); + bitsetPaths.put(bs, path); + } + LOG.info("loaded " + resourceNames.toString()); + } + catch (Exception e) + { + LOG.error("Caught exception", e); + } + } + + public AAIRequest() { + target_uri = configProperties.getProperty(TARGET_URI); + } + + public void addRequestProperty(String key, String value) { + requestProperties.put(key, value); + } + + public final void setRequestObject(AAIDatum value) { + requestDatum = value; + } + + public final AAIDatum getRequestObject() { + return requestDatum; + } + + public final void addMasterRequest(AAIRequest masterRequest) { + requestProperties.put(MASTER_REQUEST, masterRequest); + } + + protected static String encodeQuery(String param) throws UnsupportedEncodingException { + return URLEncoder.encode(param, "UTF-8").replace("+", "%20"); + } + + protected void handleException(AAIRequest lInterfaceRequest, JsonProcessingException exc) { + aaiService.getLogger().warn("Could not deserialize object of type " + lInterfaceRequest.getClass().getSimpleName(), exc) ; + } + +// public abstract URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException; + + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = null; + + request_url = target_uri + getRequestPath(); + + Set<String> uniqueResources = extractUniqueResourceSetFromKeys(requestProperties.stringPropertyNames()); + +// request_url = processPathData(request_url, requestProperties); + + for(String resoourceName:uniqueResources) { + AAIRequest locRequest = AAIRequest.createRequest(resoourceName, new HashMap<String, String>()); + if(locRequest != null) { + Class<?> clazz = locRequest.getClass(); + Method function = null; + try { + function = clazz.getMethod("processPathData", request_url.getClass(), requestProperties.getClass()); + request_url = (String) function.invoke(null, request_url, requestProperties); + } catch (Exception e) { + e.printStackTrace(); + } +// request_url = locRequest.processPathData(request_url, requestProperties); + } + } + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + + return http_req_url; + } + + + protected String getRequestPath() throws MalformedURLException { + Set<String> uniqueResources = extractUniqueResourceSetFromKeys(requestProperties.stringPropertyNames()); + BitSet bitset = new BitSet(); + for(String key : uniqueResources) { + if(tagValues.containsKey(key)) { + Object tmpValue = tagValues.get(key); + if(tmpValue != null) { + String value = tmpValue.toString(); + int bitIndex = Integer.parseInt(value); + bitset.set(bitIndex); + } + } + } + + String path = bitsetPaths.get(bitset); + if(path == null) { + throw new MalformedURLException("PATH not found for key string containing valies :" +requestProperties.toString()); + } + return path; + } + + public abstract URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException; + + public abstract String toJSONString(); + + public abstract String[] getArgsList(); + + public abstract Class<? extends AAIDatum> getModelClass() ; + + public String getPrimaryResourceName(String resource) { + return resource; + } + + public String formatKey(String argument) { + return argument; + } + + public AAIDatum jsonStringToObject(String jsonData) throws JsonParseException, JsonMappingException, IOException { + if(jsonData == null) { + return null; + } + + AAIDatum response = null; + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(jsonData, getModelClass()); + return response; + } + + protected static Set<String> extractUniqueResourceSetFromKeys(Set<String> keySet) { + Set<String> uniqueResources = new TreeSet<String>(); + List<String> keys = new ArrayList<String>(keySet); + for(String resource : keys) { + if(resource.contains(".")) { + String [] split = resource.split("\\."); + uniqueResources.add(split[0].replaceAll("_", "-")); + } + } + return uniqueResources; + } + + public void processRequestPathValues(Map<String, String> nameValues) { + Set<String> uniqueResources = extractUniqueResourceSetFromKeys(nameValues.keySet()); + + Set<String> tokens = new TreeSet<String>(); + tokens.add(DEPTH); + tokens.addAll(Arrays.asList(this.getArgsList())); + + for(String resoourceName:uniqueResources) { + AAIRequest locRequest = AAIRequest.createRequest(resoourceName, nameValues); + if(locRequest != null) + tokens.addAll(Arrays.asList(locRequest.getArgsList())); + } + + String[] arguments = tokens.toArray(new String[0]); + for(String name : arguments) { + String tmpName = name.replaceAll("-", "_"); + String value = nameValues.get(tmpName); + if(value != null && !value.isEmpty()) { + value = value.trim().replace("'", "").replace("$", "").replace("'", ""); + this.addRequestProperty(name, value); + } + } + } + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + return request_url; + } + + public boolean isDeleteDataRequired() { + return false; + } + + ObjectMapper getObjectMapper() { + return AAIService.getObjectMapper(); + } + + protected static Class<? extends AAIDatum> getClassFromResource(String resoourceName) throws ClassNotFoundException { + String className = GenericVnf.class.getName(); + String[] split = resoourceName.split("-"); + for(int i = 0; i < split.length; i++) { + split[i] = StringUtils.capitalize(split[i]); + } + + String caps = StringUtils.join(split); + className = className.replace("GenericVnf", caps); + Class<? extends AAIDatum> clazz = null; + try { + clazz = (Class<? extends AAIDatum>)Class.forName(className); + } catch (ClassNotFoundException e) { + LOG.warn("AAIRequest does not support class: " + e.getMessage()); + return null; + } + + return clazz; + } + + protected static AAIRequest getRequestFromResource(String resoourceName) { + + Class<? extends AAIDatum> clazz = null; + try { + clazz = getClassFromResource(resoourceName); + } catch (ClassNotFoundException e) { + LOG.warn("AAIRequest does not support class: " + e.getMessage()); + return null; + } + if(clazz == null) { + return null; + } + GenericRequest request = new GenericRequest(clazz); + return request; + } + + public static Map<String, String> splitQuery(String query) throws UnsupportedEncodingException { + Map<String, String> query_pairs = new LinkedHashMap<String, String>(); + + if(query != null && !query.isEmpty()) { + String[] pairs = query.split("&"); + for (String pair : pairs) { + int idx = pair.indexOf("="); + query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8")); + } + } + return query_pairs; + } + + protected boolean expectsDataFromPUTRequest() { + return false; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIService.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIService.java new file mode 100644 index 00000000..3f62374a --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIService.java @@ -0,0 +1,3278 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + + +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.security.KeyManagementException; +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.Set; +import java.util.TimeZone; +import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocketFactory; +import javax.ws.rs.HttpMethod; +import javax.xml.bind.annotation.XmlElement; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.StringUtils; +import org.onap.ccsdk.sli.core.sli.ConfigurationException; +import org.onap.ccsdk.sli.core.sli.MetricLogger; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource; +import org.openecomp.aai.inventory.v10.AvailabilityZone; +import org.openecomp.aai.inventory.v10.Complex; +import org.openecomp.aai.inventory.v10.CtagPool; +import org.openecomp.aai.inventory.v10.DvsSwitch; +import org.openecomp.aai.inventory.v10.GenericVnf; +import org.openecomp.aai.inventory.v10.L3Network; +import org.openecomp.aai.inventory.v10.OamNetwork; +import org.openecomp.aai.inventory.v10.PInterface; +import org.openecomp.aai.inventory.v10.PhysicalLink; +import org.openecomp.aai.inventory.v10.Pserver; +import org.openecomp.aai.inventory.v10.ResultData; +import org.openecomp.aai.inventory.v10.SearchResults; +import org.openecomp.aai.inventory.v10.Service; +import org.openecomp.aai.inventory.v10.ServiceInstance; +import org.openecomp.aai.inventory.v10.SitePairSet; +import org.openecomp.aai.inventory.v10.Tenant; +import org.openecomp.aai.inventory.v10.Vce; +import org.openecomp.aai.inventory.v10.VnfImage; +import org.openecomp.aai.inventory.v10.VnfImages; +import org.openecomp.aai.inventory.v10.Vpe; +import org.openecomp.aai.inventory.v10.VplsPe; +import org.openecomp.aai.inventory.v10.VpnBinding; +import org.openecomp.aai.inventory.v10.Vserver; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.openecomp.sdnc.sli.aai.data.ErrorResponse; +import org.openecomp.sdnc.sli.aai.data.RequestError; +import org.openecomp.sdnc.sli.aai.data.ResourceVersion; +import org.openecomp.sdnc.sli.aai.data.ServiceException; +import org.openecomp.sdnc.sli.aai.data.notify.NotifyEvent; +import org.openecomp.sdnc.sli.aai.data.v1507.VServer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.AnnotationIntrospector; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; +import com.fasterxml.jackson.databind.type.TypeFactory; +import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.client.urlconnection.HTTPSProperties; + + +public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicResource { + + public static final String AAICLIENT_PROPERTIES = "/aaiclient.properties"; + public static final String PATH_PROPERTIES = "/aai-path.properties"; + + private static final Logger LOG = LoggerFactory.getLogger(AAIService.class); + + private final String truststore_path; + private final String truststore_password; + private final String keystore_path; + private final String keystore_password; + private final Boolean ignore_certificate_host_error; + + private final String target_uri; + private final String query_path; // = "sdn-zone-query"; + + private final String network_vserver_path; + + private final String svc_instance_path; + private final String svc_inst_qry_path; + + private final String vnf_image_query_path; + + private final String param_service_type; //= "service-type"; + + private final String ubb_notify_path; + private final String selflink_avpn; + private final String selflink_fqdn; + + private final String p_interface_path; + + private final String service_path; + private final String site_pair_set_path; + + private final int connection_timeout; + private final int read_timeout; + + // 1602 + private final String query_nodes_path; + private final String update_path; + + private final String application_id; + + // authentication credentials + private String user_name; + private String user_password; + + // runtime + private final boolean runtimeOSGI; + + private SSLContext CTX; + + private final MetricLogger ml = new MetricLogger(); + + private final AAIRequestExecutor executor; + + public AAIService(URL propURL) { + LOG.info("Entered AAIService.ctor"); + + String runtime = System.getProperty("aaiclient.runtime"); + if(runtime != null && runtime.equals("OSGI")) { + runtimeOSGI = true; + } else { + runtimeOSGI = false; + } + + Properties props = null; + try { + props = initialize(propURL); + AAIRequest.setProperties(props, this); + + } catch(Exception exc){ + LOG.error("AicAAIResource.static", exc); + } + + executor = new AAIRequestExecutor(); + + user_name = props.getProperty(CLIENT_NAME); + user_password = props.getProperty(CLIENT_PWWD); + + if(user_name == null || user_name.isEmpty()){ + LOG.debug("Basic user name is not set"); + } + if(user_password == null || user_password.isEmpty()) { + LOG.debug("Basic password is not set"); + } + + truststore_path = props.getProperty(TRUSTSTORE_PATH); + truststore_password = props.getProperty(TRUSTSTORE_PSSWD); + keystore_path = props.getProperty(KEYSTORE_PATH); + keystore_password = props.getProperty(KEYSTORE_PSSWD); + + target_uri = props.getProperty(TARGET_URI); + query_path = props.getProperty(QUERY_PATH); + update_path = props.getProperty(UPDATE_PATH); + + String applicationId =props.getProperty(APPLICATION_ID); + if(applicationId == null || applicationId.isEmpty()) { + applicationId = "SDNC"; + } + application_id = applicationId; + + // connection timeout + int tmpConnectionTimeout = 30000; + int tmpReadTimeout = 30000; + + try { + String tmpValue = null; + tmpValue = props.getProperty(CONNECTION_TIMEOUT, "30000"); + tmpConnectionTimeout = Integer.parseInt(tmpValue); + tmpValue = props.getProperty(READ_TIMEOUT, "30000"); + tmpReadTimeout = Integer.parseInt(tmpValue); + } catch(Exception exc) { + LOG.error("Failed setting connection timeout", exc); + tmpConnectionTimeout = 30000; + tmpReadTimeout = 30000; + } + connection_timeout = tmpConnectionTimeout; + read_timeout = tmpReadTimeout; + + network_vserver_path =props.getProperty(NETWORK_VSERVER_PATH); + + svc_instance_path = props.getProperty(SVC_INSTANCE_PATH); // "/aai/v1/business/customers/customer/{customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances"); +// "/aai/v1/business/customers/customer/ma9181-203-customerid/service-subscriptions/service-subscription/ma9181%20Hosted%20Voice/service-instances"; + +// svc_inst_qry_path = props.getProperty(SVC_INST_QRY_PATH, "/aai/v1/search/generic-query?key=service-instance.service-instance-id:ma9181-204-instance&start-node-type=service-instance&include=service-instance"); + svc_inst_qry_path = props.getProperty(SVC_INST_QRY_PATH); // "/aai/v1/search/generic-query?key=service-instance.service-instance-id:{svc-instance-id}&start-node-type=service-instance&include=service-instance"); + + + param_service_type = props.getProperty(PARAM_SERVICE_TYPE, "service-type"); + + // P-Interfaces + p_interface_path = props.getProperty(P_INTERFACE_PATH); + + vnf_image_query_path = props.getProperty(VNF_IMAGE_QUERY_PATH); + + ubb_notify_path = props.getProperty(UBB_NOTIFY_PATH); + selflink_avpn = props.getProperty(SELFLINK_AVPN); + selflink_fqdn = props.getProperty(SELFLINK_FQDN); + + service_path = props.getProperty(SERVICE_PATH); + + site_pair_set_path = props.getProperty(SITE_PAIR_SET_PATH); + + query_nodes_path = props.getProperty(QUERY_NODES_PATH); + + String iche = props.getProperty(CERTIFICATE_HOST_ERROR); + boolean host_error = false; + if(iche != null && !iche.isEmpty()) { + host_error = Boolean.valueOf(iche); + } + + ignore_certificate_host_error = host_error; + + HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){ + public boolean verify(String string,SSLSession ssls) { + return ignore_certificate_host_error; + } + }); + + if(truststore_path != null && truststore_password != null && (new File(truststore_path)).exists()) { + System.setProperty("javax.net.ssl.trustStore", truststore_path); + System.setProperty("javax.net.ssl.trustStorePassword", truststore_password); + } + + if(keystore_path != null && keystore_password != null && (new File(keystore_path)).exists()) + { + DefaultClientConfig config = new DefaultClientConfig(); + //both jersey and HttpURLConnection can use this + SSLContext ctx = null; + try { + ctx = SSLContext.getInstance("TLS"); + + KeyManagerFactory kmf = null; + try { + String def = "SunX509"; + String storeType = "PKCS12"; + def = KeyStore.getDefaultType(); + kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + FileInputStream fin = new FileInputStream(keystore_path); +// KeyStore ks = KeyStore.getInstance("PKCS12"); + + String extension = keystore_path.substring(keystore_path.lastIndexOf(".") + 1); + + if(extension != null && !extension.isEmpty() && extension.equalsIgnoreCase("JKS")) { + storeType = "JKS"; + } + KeyStore ks = KeyStore.getInstance(storeType); + + char[] pwd = keystore_password.toCharArray(); + ks.load(fin, pwd); + kmf.init(ks, pwd); + } catch (Exception ex) { + LOG.error("AAIResource", ex); + } + + 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 ignore_certificate_host_error; + } + }, ctx)); + + CTX = ctx; + LOG.debug("SSLContext created"); + + } catch (KeyManagementException | NoSuchAlgorithmException exc) { + LOG.error("AAIResource", exc); + } + } + + LOG.info("AAIResource.ctor initialized."); + + try { + Field methodsField = HttpURLConnection.class.getDeclaredField("methods"); + methodsField.setAccessible(true); + // get the methods field modifiers + Field modifiersField = Field.class.getDeclaredField("modifiers"); + // bypass the "private" modifier + modifiersField.setAccessible(true); + + // remove the "final" modifier + modifiersField.setInt(methodsField, methodsField.getModifiers() & ~Modifier.FINAL); + + /* valid HTTP methods */ + String[] methods = { + "GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE", "PATCH" + }; + // set the new methods - including patch + methodsField.set(null, methods); + + } catch (SecurityException | IllegalArgumentException | IllegalAccessException | NoSuchFieldException e) { + e.printStackTrace(); + } + + } + + public void cleanUp() { + + } + + /** + * + * @param http_req_url + * @param method + * @return + * @throws Exception + */ + protected HttpURLConnection getConfiguredConnection(URL http_req_url, String method) throws Exception { + HttpURLConnection con = (HttpURLConnection) http_req_url.openConnection(); + + // Set up the connection properties + con.setRequestProperty( "Connection", "close" ); + con.setDoInput(true); + con.setDoOutput(true); + con.setUseCaches(false); + con.setConnectTimeout( connection_timeout ); + con.setReadTimeout( read_timeout ); + con.setRequestMethod( method ); + con.setRequestProperty( "Accept", "application/json" ); + con.setRequestProperty( "Content-Type", "PATCH".equalsIgnoreCase(method) ? "application/merge-patch+json" : "application/json" ); + con.setRequestProperty("X-FromAppId", application_id); + con.setRequestProperty("X-TransactionId",TransactionIdTracker.getNextTransactionId()); + con.setRequestProperty(MetricLogger.REQUEST_ID, ml.getRequestID()); + + if(user_name != null && !user_name.isEmpty() && user_password != null && !user_password.isEmpty()) { + String basicAuth = "Basic " + new String(Base64.encodeBase64((user_name + ":" + user_password).getBytes())); + con.setRequestProperty ("Authorization", basicAuth); + } + + if(con instanceof HttpsURLConnection && CTX != null) { + SSLSocketFactory sockFact = CTX.getSocketFactory(); + HttpsURLConnection.class.cast(con).setSSLSocketFactory( sockFact ); + } + return con; + } + + + @Override + public GenericVnf requestGenericVnfData(String vnf_id) throws AAIServiceException { + GenericVnf response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("generic-vnf"); + request.addRequestProperty("generic-vnf.vnf-id", vnf_id); + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, GenericVnf.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + + return response; + + } + + @Override + public boolean postGenericVnfData(String vnf_id, GenericVnf data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("generic-vnf"); + request.addRequestProperty("generic-vnf.vnf-id", vnf_id); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestGenericVnfData", exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deleteGenericVnfData(String vnf_id, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("generic-vnf"); + request.addRequestProperty("generic-vnf.vnf-id", vnf_id); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteGenericVnfData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + /* (non-Javadoc) + * @see org.openecomp.sdnc.sli.resource.aic.AnAIClient#requestSdnZoneQuery(java.lang.String, java.lang.String, java.lang.String) + */ + @Override + public Vce requestNetworkVceData(String vnf_id) throws AAIServiceException { + Vce response = null; + try { + AAIRequest request = AAIRequest.getRequestFromResource("vce"); + request.addRequestProperty("vce.vnf-id", vnf_id); + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, Vce.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + + return response; + } + + + /* (non-Javadoc) + * @see org.openecomp.sdnc.sli.resource.aic.AnAIClient#requestSdnZoneQuery(java.lang.String, java.lang.String, java.lang.String) + */ + @Override + public boolean deleteNetworkVceData(String vnf_id, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vce"); + request.addRequestProperty("vce.vnf-id", vnf_id); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteNetworkVceData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + /* (non-Javadoc) + * @see org.openecomp.sdnc.sli.resource.aic.AnAIClient#postNetworkVceData(java.lang.String, org.openecomp.sdnc.sli.resource.aic.aai.VCERequest) + */ + @Override + public boolean postNetworkVceData(String vnf_id, Vce data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("vce"); + request.addRequestProperty("vce.vnf-id", vnf_id); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestGenericVnfData", exc); + throw new AAIServiceException(exc); + } + } + + + @Override + public SearchResults requestServiceInstanceURL(String svc_instance_id) throws AAIServiceException { + SearchResults response = null; + InputStream inputStream = null; + + try { + String path = svc_inst_qry_path; + path = path.replace("{svc-instance-id}", encodeQuery(svc_instance_id)); + + String request_url = target_uri+path; + URL http_req_url = new URL(request_url); + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.GET); + + LOGwriteFirstTrace(HttpMethod.GET, http_req_url.toString()); + LOGwriteDateTrace("svc_instance_id", svc_instance_id); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode); + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK) { +// StringBuilder stringBuilder = new StringBuilder("\n"); +// String line = null; +// while( ( line = reader.readLine() ) != null ) { +// stringBuilder.append("\n").append( line ); +// } +// LOG.info(stringBuilder.toString()); + response = mapper.readValue(reader, SearchResults.class); + LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, "SUCCESS", mapper.writeValueAsString(response)); + } else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) { + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + return response; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestServiceInstanceURL", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + @Override + public ServiceInstance requestServiceInterfaceData(String customer_id, String service_type, String svc_instance_id) throws AAIServiceException { + ServiceInstance response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("service-instance"); + request.addRequestProperty("customer.global-customer-id", customer_id); + request.addRequestProperty("ervice-subscription.service-type", service_type); + request.addRequestProperty("service-instance.service-instance-id", svc_instance_id); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, ServiceInstance.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestServiceInterfaceData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean postServiceInterfaceData(String customer_id, String service_type, String svc_instance_id, ServiceInstance data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("service-instance"); + request.addRequestProperty("customer.customer-id", customer_id); + request.addRequestProperty("service-subscription.service-type", service_type); + request.addRequestProperty("service-instance.service-instance-id", svc_instance_id); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestGenericVnfData", exc); + throw new AAIServiceException(exc); + } + } + + + private static Properties initialize(URL url ) throws ConfigurationException { + + if(url == null) { + throw new NullPointerException(); + } + + InputStream is = null; + Properties props = new Properties(); + + try { + if(LOG.isDebugEnabled()) + LOG.info("Property file is: " + url.toString()); + + is = url.openStream(); + + props.load(is); + if(LOG.isDebugEnabled()) { + LOG.info("Properties loaded: " + props.size()); + Enumeration<Object> en = props.keys(); + + while(en.hasMoreElements()) { + String key = (String)en.nextElement(); + String property = props.getProperty(key); + LOG.debug(key + " : " + property); + } + } + } catch (Exception e) { + throw new ConfigurationException("Could not load properties file.", e); + } + return props; + } + + static class TransactionIdTracker { +// protected static AtomicLong tracker = new AtomicLong(); + + public static String getNextTransactionId() { +// long id = tracker.getAndIncrement(); +// String transactionId = String.format("N%016X", id); + String transactionId = UUID.randomUUID().toString(); + return transactionId; + } + + } + + protected void LOGwriteFirstTrace(String method, String url) { + String time = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(System.currentTimeMillis()); + LOG.info("A&AI transaction :"); + LOG.info("Request Time : " + time + ", Method : " + method); + LOG.info("Request URL : "+ url); + } + + protected void LOGwriteDateTrace(String name, String data) { + LOG.info("Input - " + name + " : " + data); + } + + protected void LOGwriteEndingTrace(int response_code, String comment, String data) { + LOG.info("Response code : " + response_code +", " + comment); + LOG.info(String.format("Response data : %s", data)); + } + + protected String encodeQuery(String param) throws UnsupportedEncodingException { + return URLEncoder.encode(param, "UTF-8").replace("+", "%20"); + } + + private String encodeCustomerURL(final String selection) + { + String encrypted_url = selection; + String apnpattern = + "/aai/v10/business/customers/customer/(.+)/service-subscriptions/service-subscription/(.+)/service-instances/service-instance/(.+)/"; + Pattern pattern = Pattern.compile(apnpattern); + + try { + URL url = new URL(selection); + String path = url.getPath(); + + LOG.info("Trying to match apn to <" + path + ">"); + + Matcher matcher = pattern.matcher(path); + + while(matcher.find()) { + String customer = matcher.group(1); + String subscription = matcher.group(2); + String service = matcher.group(3); + + encrypted_url = selection.replace(customer, encodeQuery(customer)); + encrypted_url = encrypted_url.replace(subscription, encodeQuery(subscription)); + encrypted_url = encrypted_url.replace(service, encodeQuery(service)); + } + } catch (Exception e) { + LOG.warn("", e); + } + + return encrypted_url; + } + + @Override + public Vpe requestNetworkVpeData(String vnf_id) throws AAIServiceException { + Vpe response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vpe"); + request.addRequestProperty("vpe.vnf-id", vnf_id); + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, Vpe.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean postNetworkVpeData(String vnf_id, Vpe data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("vpe"); + request.addRequestProperty("vpe.vnf-id", vnf_id); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deleteNetworkVpeData(String vnf_id, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vpe"); + request.addRequestProperty("vpe.vnf-id", vnf_id); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public VplsPe requestNetworkVplsPeData(String equipment_name)throws AAIServiceException { + VplsPe response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vpls-pe"); + request.addRequestProperty("vpls-pe.equipment-name", equipment_name); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, VplsPe.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean postNetworkVplsPeData(String equipment_name, VplsPe data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("vpls-pe"); + request.addRequestProperty("vpls-pe.equipment-name", equipment_name); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestGenericVnfData", exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deleteNetworkVplsPeData(String vnf_id, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vpls-pe"); + request.addRequestProperty("vpls-pe.equipment-name", vnf_id); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteNetworkVplsPeData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public Complex requestNetworkComplexData(String pLocId) throws AAIServiceException { + Complex response = null; + InputStream inputStream = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("complex"); + request.addRequestProperty("complex.physical-location-id", pLocId); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, Complex.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestNetworkComplexData", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + @Override + public boolean postNetworkComplexData(String vnf_id, Complex data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("complex"); + request.addRequestProperty("complex.physical-location-id", vnf_id); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("postNetworkComplexData", exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deleteNetworkComplexData(String pLocId, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("complex"); + request.addRequestProperty("complex.physical-location-id", pLocId); + + response = executor.delete(request, resourceVersion); + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteNetworkComplexData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + /* + * (non-Javadoc) + * @see org.openecomp.sdnct.sli.aai.AAIClient#requestVServersData(java.lang.String, java.lang.String) + */ + @Override + public Vserver requestVServerData(String tenantId, String vserverId, String cloudOwner, String cloudRegionId) throws AAIServiceException { + Vserver response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vserver"); + request.addRequestProperty("cloud-region.cloud-owner", cloudOwner); + request.addRequestProperty("cloud-region.cloud-region-id", cloudRegionId); + request.addRequestProperty("tenant.tenant-id", tenantId); + request.addRequestProperty("vserver.vserver-id", vserverId); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, Vserver.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + return response; + } + + + @Override + public boolean postVServerData(String tenantId, String vserverId, String cloudOwner, String cloudRegionId, Vserver data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("vserver"); + request.addRequestProperty("cloud-region.cloud-owner", cloudOwner); + request.addRequestProperty("cloud-region.cloud-region-id", cloudRegionId); + request.addRequestProperty("tenant.tenant-id", tenantId); + request.addRequestProperty("vserver.vserver-id", vserverId); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("postNetworkComplexData", exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deleteVServerData(String tenant_id, String vserver_id, String cloudOwner, String cloudRegionId, String resourceVersion) throws AAIServiceException { + boolean response = false; + InputStream inputStream = null; + + try { + String local_network_complexes_path = network_vserver_path.replace("{tenant-id}", encodeQuery(tenant_id)); + local_network_complexes_path = local_network_complexes_path.replace("{vserver-id}", encodeQuery(vserver_id)); + local_network_complexes_path = local_network_complexes_path.replace("{cloud-owner}", encodeQuery(cloudOwner)); + local_network_complexes_path = local_network_complexes_path.replace("{cloud-region-id}", encodeQuery(cloudRegionId)); + + String request_url = target_uri+local_network_complexes_path; + if(resourceVersion!=null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.DELETE); + + LOGwriteFirstTrace(HttpMethod.DELETE, http_req_url.toString()); + LOGwriteDateTrace("tenant_id", tenant_id); + LOGwriteDateTrace("vserver_id", vserver_id); + LOGwriteDateTrace("cloud-owner", cloudOwner); + LOGwriteDateTrace("cloud-region-id", cloudRegionId); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode); + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + String line = null; + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, "SUCCESS", stringBuilder.toString()); + response = true; + } else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) { + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + response = false; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteVServerData", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + + /* + * (non-Javadoc) + * @see org.openecomp.sdnc.sli.aai.AAIClient#requestCtagPoolData(String) + */ + @Override + public CtagPool requestCtagPoolData(String physical_location_id, String target_pe, String availability_zone_name) throws AAIServiceException { + CtagPool response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("ctag-pool"); + + request.addRequestProperty("ctag-pool.target-pe", target_pe); + request.addRequestProperty("ctag-pool.availability-zone-name", availability_zone_name); + request.addRequestProperty("complex.physical-location-id", physical_location_id); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, CtagPool.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestNetworkVceData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + //==================== DvsSwitch ====================== + @Override + public DvsSwitch requestDvsSwitchData(String vnf_id) throws AAIServiceException { + DvsSwitch response = null; + InputStream inputStream = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("dvs-switch"); + request.addRequestProperty("dvs-switch.switch-name", vnf_id); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, DvsSwitch.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestDvsSwitchData", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + @Override + public boolean postDvsSwitchData(String switch_name, DvsSwitch data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("dvs-switch"); + request.addRequestProperty("dvs-switch.switch-name", switch_name); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deleteDvsSwitchData(String vnf_id, String resourceVersion) throws AAIServiceException { + boolean response = false; + InputStream inputStream = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("dvs-switch"); + request.addRequestProperty("dvs-switch.switch-name", vnf_id); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteDvsSwitchData", exc); + throw new AAIServiceException(exc); + } + return response; + } + //================== End of DvsSwitch ================= + //==================== PhysicalLink ====================== + @Override + public PhysicalLink requestPhysicalLinkData(String linkName) throws AAIServiceException { + PhysicalLink response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("physical-link"); + request.addRequestProperty("physical-link.link-name", linkName); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, PhysicalLink.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestPhysicalLinkData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean postPhysicalLinkData(String linkName, PhysicalLink data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("physical-link"); + request.addRequestProperty("physical-link.link-name", linkName); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deletePhysicalLinkData(String linkName, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("physical-link"); + request.addRequestProperty("physical-link.link-name", linkName); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deletePhysicalLinkData", exc); + throw new AAIServiceException(exc); + } + return response; + } + //================== End of PhysicalLink ================= + //==================== PInterface ====================== + @Override + public PInterface requestPInterfaceData(String hostname, String interfaceName) throws AAIServiceException { + PInterface response = null; + + try { + AAIRequest request = new PInterfaceRequest(); + request.addRequestProperty(PInterfaceRequest.PINTERFACE_INTERFACE_NAME, interfaceName); + request.addRequestProperty(PInterfaceRequest.PSERVER_HOSTNAME, hostname); + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, PInterface.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean postPInterfaceData(String hostname, String interfaceName, PInterface request) throws AAIServiceException { + InputStream inputStream = null; + + try { + + ObjectMapper mapper = getObjectMapper(); + String json_text = mapper.writeValueAsString(request); + + SSLSocketFactory sockFact = CTX.getSocketFactory(); + + String request_url = target_uri+p_interface_path; + String encoded_vnf = encodeQuery(hostname); + request_url = request_url.replace("{hostname}", encoded_vnf) ; + encoded_vnf = encodeQuery(interfaceName); + request_url = request_url.replace("{interface-name}", encoded_vnf) ; + URL http_req_url = new URL(request_url); + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.PUT); + + OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); + osw.write(json_text); + osw.flush(); + osw.close(); + + + LOGwriteFirstTrace("PUT", request_url); + LOGwriteDateTrace("hostname", hostname); + LOGwriteDateTrace("interface-name", interfaceName); + LOGwriteDateTrace("PInterface", json_text); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + BufferedReader reader; + String line = null; + reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, "SUCCESS", (stringBuilder != null) ? stringBuilder.toString() : "{no-data}"); + return true; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + + throw new AAIServiceException(responseCode, errorresponse); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("postPInterfaceData", exc); + throw new AAIServiceException(exc); + } finally { + try { + if(inputStream != null) + inputStream.close(); + } catch (Exception exc) { + + } + } + } + + @Override + public boolean deletePInterfaceData(String hostname, String interfaceName, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("p-interface"); + request.addRequestProperty("p-interface.interface-name", interfaceName); + request.addRequestProperty("pserver.hostname", hostname); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deletePInterfaceData", exc); + throw new AAIServiceException(exc); + } + return response; + } + //================== End of PInterface ================= + //==================== SitePairSet ====================== + @Override + public SitePairSet requestSitePairSetData(String sitePairSetId) throws AAIServiceException { + SitePairSet response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("site-pair-set"); + request.addRequestProperty("site-pair-set.site-pair-set-id", sitePairSetId); + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, SitePairSet.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean postSitePairSetData(String linkName, SitePairSet request) throws AAIServiceException { + InputStream inputStream = null; + + try { + + ObjectMapper mapper = getObjectMapper(); + String json_text = mapper.writeValueAsString(request); + + SSLSocketFactory sockFact = CTX.getSocketFactory(); + + String request_url = target_uri+site_pair_set_path; + String encoded_vnf = encodeQuery(linkName); + request_url = request_url.replace("{site-pair-set-id}", encoded_vnf) ; + URL http_req_url = new URL(request_url); + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.PUT); + + OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); + osw.write(json_text); + osw.flush(); + osw.close(); + + + LOGwriteFirstTrace("PUT", request_url); + LOGwriteDateTrace("link-name", linkName); + LOGwriteDateTrace("SitePairSet", json_text); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + BufferedReader reader; + String line = null; + reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, "SUCCESS", (stringBuilder != null) ? stringBuilder.toString() : "{no-data}"); + return true; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + + throw new AAIServiceException(responseCode, errorresponse); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("postSitePairSetData", exc); + throw new AAIServiceException(exc); + } finally { + try { + if(inputStream != null) + inputStream.close(); + } catch (Exception exc) { + + } + } + } + + @Override + public boolean deleteSitePairSetData(String linkName, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("site-pair-set"); + request.addRequestProperty("site-pair-set.site-pair-set-id", linkName); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteSitePairSetData", exc); + throw new AAIServiceException(exc); + } + + return response; + } + //================== End of SitePairSet ================= + //==================== Service ====================== + @Override + public Service requestServiceData(String serviceId) throws AAIServiceException { + Service response = null; + InputStream inputStream = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("service"); + request.addRequestProperty("service.service-id", serviceId); + + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, Service.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestServiceData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean postServiceData(String linkName, Service request) throws AAIServiceException { + InputStream inputStream = null; + + try { + + ObjectMapper mapper = getObjectMapper(); + String json_text = mapper.writeValueAsString(request); + + SSLSocketFactory sockFact = CTX.getSocketFactory(); + + String request_url = target_uri+service_path; + String encoded_vnf = encodeQuery(linkName); + request_url = request_url.replace("{service-id}", encoded_vnf) ; + URL http_req_url = new URL(request_url); + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.PUT); + + OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); + osw.write(json_text); + osw.flush(); + osw.close(); + + + LOGwriteFirstTrace("PUT", request_url); + LOGwriteDateTrace("service-id", linkName); + LOGwriteDateTrace("Service", json_text); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + BufferedReader reader; + String line = null; + reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, "SUCCESS", (stringBuilder != null) ? stringBuilder.toString() : "{no-data}"); + return true; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + + throw new AAIServiceException(responseCode, errorresponse); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("postServiceData", exc); + throw new AAIServiceException(exc); + } finally { + try { + if(inputStream != null) + inputStream.close(); + } catch (Exception exc) { + + } + } + } + + @Override + public boolean deleteServiceData(String service_id, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("service"); + request.addRequestProperty("service.service-id", service_id); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteServiceData", exc); + throw new AAIServiceException(exc); + } + + return response; + } + //================== End of Service ================= + + + + // 1507 - Request + @Override + public VServer dataChangeRequestVServerData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), VServer.class); + } + + @Override + public Pserver dataChangeRequestPServerData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), Pserver.class); + } + + @Override + public CtagPool dataChangeRequestCtagPoolData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), CtagPool.class); + } + + @Override + public VplsPe dataChangeRequestVplsPeData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), VplsPe.class); + } + + @Override + public Vpe dataChangeRequestVpeData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), Vpe.class); + } + + @Override + public DvsSwitch dataChangeRequestDvsSwitchData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), DvsSwitch.class); + } + + @Override + public OamNetwork dataChangeRequestOAMNetworkData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), OamNetwork.class); + } + + @Override + public AvailabilityZone dataChangeRequestAvailabilityZoneData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), AvailabilityZone.class); + } + + @Override + public Complex dataChangeRequestComplexData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return this.getResource(url.toString(), Complex.class); + } + + /* DELETE */ + public boolean dataChangeDeleteVServerData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return deleteAAIEntity(url, new Object(){}.getClass().getEnclosingMethod().getName()); + } + + public boolean dataChangeDeleteCtagPoolData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return deleteAAIEntity(url, new Object(){}.getClass().getEnclosingMethod().getName()); + } + + public boolean dataChangeDeleteVplsPeData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return deleteAAIEntity(url, new Object(){}.getClass().getEnclosingMethod().getName()); + } + + public boolean dataChangeDeleteVpeData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return deleteAAIEntity(url, new Object(){}.getClass().getEnclosingMethod().getName()); + } + + public boolean dataChangeDeleteDvsSwitchData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return deleteAAIEntity(url, new Object(){}.getClass().getEnclosingMethod().getName()); + } + //OAM-Network: + public boolean dataChangeDeleteOAMNetworkData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return deleteAAIEntity(url, new Object(){}.getClass().getEnclosingMethod().getName()); + } + //Availability-Zone: + public boolean dataChangeDeleteAvailabilityZoneData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return deleteAAIEntity(url, new Object(){}.getClass().getEnclosingMethod().getName()); + } + //Complex: + public boolean dataChangeDeleteComplexData(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + return deleteAAIEntity(url, new Object(){}.getClass().getEnclosingMethod().getName()); + } + + private boolean deleteAAIEntity(URL url, String caller) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + boolean response = false; + InputStream inputStream = null; + + try { + URL http_req_url = url; + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.DELETE); + +// SSLSocketFactory sockFact = CTX.getSocketFactory(); +// con.setSSLSocketFactory( sockFact ); + + LOGwriteFirstTrace("DELETE", http_req_url.toString()); + + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode); + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + String line = null; + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, "SUCCESS", stringBuilder.toString()); + response = true; + } else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) { + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + response = false; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(caller, exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + /** + * Generic method to GET json data from an A&AI callback URL. + * Then convert that json to an Object. + * If successful the Object is attempted to be cast to the type parameter. + * + * @param key + * callback url for A&AI + * @param type + * the class of object that A&AI will return + * @return the object created from json or null if the response code is not 200 + * + * @throws AAIServiceException + * if empty or null key and or type or there's an error with processing + */ + public <T> T dataChangeRequestAaiData(String key, Class<T> type) throws AAIServiceException { + if (StringUtils.isEmpty(key) || type == null) { + throw new AAIServiceException("Key is empty or null and or type is null"); + } + + T response = null; + + SvcLogicContext ctx = new SvcLogicContext(); + if(!key.contains(" = ") && isValidURL(key)) { + key = String.format("selflink = '%s'", key); + } + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + + SelfLinkRequest request = new SelfLinkRequest(type); + request.processRequestPathValues(nameValues); + Object obj = this.getExecutor().query(request, type); + response = type.cast(obj); + + return response != null ? type.cast(response) : response; + } + + @Override + public Pserver requestPServerData(String hostname) throws AAIServiceException { + Pserver response = null; + InputStream inputStream = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("pserver"); + request.addRequestProperty("pserver.hostname", hostname); + + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, Pserver.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestPServerData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean postPServerData(String hostname, Pserver data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("pserver"); + request.addRequestProperty("pserver.hostname", hostname); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deletePServerData(String hostname, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("pserver"); + request.addRequestProperty("pserver.hostname", hostname); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deletePServerData", exc); + throw new AAIServiceException(exc); + } + + return response; + } + + + @Override + public L3Network requestL3NetworkData(String networkId) throws AAIServiceException { + L3Network response = null; + InputStream inputStream = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("l3-network"); + request.addRequestProperty("l3-network.network-id", networkId); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, L3Network.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestL3NetworkData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public L3Network requestL3NetworkQueryByName(String networkName) throws AAIServiceException { + L3Network response = null; + InputStream inputStream = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("l3-network"); + request.addRequestProperty("l3-network.network-name", networkName); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, L3Network.class); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestL3NetworkQueryByName", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + @Override + public boolean postL3NetworkData(String networkId, L3Network data) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("l3-network"); + request.addRequestProperty("l3-network.network-id", networkId); + request.setRequestObject(data); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn(new Object(){}.getClass().getEnclosingMethod().getName(), exc); + throw new AAIServiceException(exc); + } + } + + @Override + public boolean deleteL3NetworkData(String networkId, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("l3-network"); + request.addRequestProperty("l3-network.network-id", networkId); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteL3NetworkData", exc); + throw new AAIServiceException(exc); + } + + return response; + } + + + @Override + public VpnBinding requestVpnBindingData(String vpnId) throws AAIServiceException { + VpnBinding response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vpn-binding"); + request.addRequestProperty("vpn-binding.vpn-id", vpnId); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, VpnBinding.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestVpnBindingData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public boolean deleteVpnBindingData(String vpnId, String resourceVersion) throws AAIServiceException { + boolean response = false; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vpn-binding"); + request.addRequestProperty("vpn-binding.vpn-id", vpnId); + response = executor.delete(request, resourceVersion); + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteVpnBindingData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + + @Override + public VnfImage requestVnfImageData(String att_uuid) throws AAIServiceException { + VnfImage response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("vnf-image"); + request.addRequestProperty("vnf-image.att-uuid", att_uuid); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, VnfImage.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestVnfImageData", exc); + throw new AAIServiceException(exc); + } + return response; + } + + @Override + public VnfImage requestVnfImageDataByVendorModel(String vendor, String model) throws AAIServiceException { + return requestVnfImageDataByVendorModelVersion(vendor, model, null); + } + + @Override + public VnfImage requestVnfImageDataByVendorModelVersion(String vendor, String model, String version) throws AAIServiceException + { + List<VnfImage> responseList = new ArrayList<VnfImage>(); + VnfImage response = null; + InputStream inputStream = null; + + try { + String request_url = target_uri+vnf_image_query_path + (version==null? "": "&application-version={application_version}"); + request_url = request_url.replace("{application_vendor}", encodeQuery(vendor)) ; + request_url = request_url.replace("{application_model}", encodeQuery(model)) ; + if(version != null) { + request_url = request_url.replace("{application_version}", encodeQuery(version)) ; + } + URL http_req_url = new URL(request_url); + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.GET); + + LOGwriteFirstTrace(HttpMethod.GET, http_req_url.toString()); + LOGwriteDateTrace("application_vendor", vendor); + LOGwriteDateTrace("application_model", model); + if(version != null) { + LOGwriteDateTrace("application_version", version); + } + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode); + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK) { +// StringBuilder stringBuilder = new StringBuilder("\n"); +// String line = null; +// while( ( line = reader.readLine() ) != null ) { +// stringBuilder.append("\n").append( line ); +// } +// LOG.info(stringBuilder.toString()); + response = mapper.readValue(reader, VnfImage.class); + String original_buffer = mapper.writeValueAsString(response); + LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, "SUCCESS", original_buffer); + if(response.getApplicationVendor() == null /*&& response.getAdditionalProperties() != null && !response.getAdditionalProperties().isEmpty()*/){ + LOG.warn("A List of multiple VNF-IMAGE entries has been returned"); + VnfImages listOfObjects = mapper.readValue(original_buffer, VnfImages.class); + if(!listOfObjects.getVnfImage().isEmpty()) { + response = listOfObjects.getVnfImage().get(0); + } + } + } else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) { + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + return response; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestVnfImageData", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + + public boolean sendNotify(NotifyEvent event, String serviceInstanceId, String pathCode) throws AAIServiceException { + InputStream inputStream = null; + + try { + + String selfLink = selflink_fqdn; + if(SELFLINK_AVPN != null && SELFLINK_AVPN.equals(pathCode)) { + selfLink = selflink_avpn; + } + selfLink = selfLink.replace("{service-instance-id}", encodeQuery(serviceInstanceId)); + event.setSelflink(selfLink); + + ObjectMapper mapper = getObjectMapper(); + String json_text = mapper.writeValueAsString(event); + + SSLSocketFactory sockFact = CTX.getSocketFactory(); + + String request_url = target_uri+ubb_notify_path; + URL http_req_url = new URL(request_url); + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.PUT); + + OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); + osw.write(json_text); + osw.flush(); + osw.close(); + + + LOGwriteFirstTrace("PUT", request_url); + LOGwriteDateTrace("NotifyEvent", json_text); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + BufferedReader reader; + String line = null; + reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, "SUCCESS", (stringBuilder != null) ? stringBuilder.toString() : "{no-data}"); + return true; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + + throw new AAIServiceException(responseCode, errorresponse); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("sendNotify", exc); + throw new AAIServiceException(exc); + } finally { + try { + if(inputStream != null) + inputStream.close(); + } catch (Exception exc) { + + } + } + } + + @Override + public SearchResults requestNodeQuery(String node_type, String entityIdentifier, String entityName) throws AAIServiceException { + SearchResults response = null; + InputStream inputStream = null; + + try { + String request_url = target_uri+query_nodes_path; + request_url = request_url.replace("{node-type}", encodeQuery(node_type)) ; + request_url = request_url.replace("{entity-identifier}", entityIdentifier) ; + request_url = request_url.replace("{entity-name}", encodeQuery(entityName)) ; + URL http_req_url = new URL(request_url); + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.GET); + + LOGwriteFirstTrace(HttpMethod.GET, http_req_url.toString()); + LOGwriteDateTrace("node_type", node_type); + LOGwriteDateTrace("vnf_name", entityName); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode); + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK) { + response = mapper.readValue(reader, SearchResults.class); + LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, "SUCCESS", mapper.writeValueAsString(response)); + } else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + return response; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestNodeQuery", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + + } + + + @Override + public String requestDataByURL(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + String response = null; + InputStream inputStream = null; + + try { + URL http_req_url = url; + + HttpURLConnection con = getConfiguredConnection(http_req_url, HttpMethod.GET); + + LOGwriteFirstTrace(HttpMethod.GET, http_req_url.toString()); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode); + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK) { + StringBuilder stringBuilder = new StringBuilder("\n"); + String line = null; + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOG.info(stringBuilder.toString()); +// response = mapper.readValue(reader, String.class); + response = stringBuilder.toString(); + LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, "SUCCESS", mapper.writeValueAsString(response)); + } else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) { + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + response = null; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestNetworkVceData", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + + @Override + public GenericVnf requestGenericVnfeNodeQuery(String vnf_name) throws AAIServiceException { + + if(vnf_name == null) { + throw new NullPointerException(); + } + + GenericVnf entity = null; + SearchResults resp = this.requestNodeQuery("generic-vnf", "vnf-name", vnf_name); + + List<ResultData> resultDataList = resp.getResultData(); + + try { + for (ResultData datum : resultDataList) { + String data_type = datum.getResourceType(); + URL url = new URL(datum.getResourceLink()); + entity = this.getResource(url.toString(), GenericVnf.class); + } + } + catch (Exception e) + { + LOG.error("Caught exception", e); + } + return entity; + } + + @Override + public Vserver requestVServerDataByURL(URL url) throws AAIServiceException { + + if(url == null) { + throw new NullPointerException(); + } + + Vserver entity = null; + + try { + entity = this.getResource(url.toString(), Vserver.class); + } catch (AAIServiceException exc) { + throw exc; + } catch (Exception e) { + throw new AAIServiceException(e); + } + return entity; + } + + @Override + public URL requestVserverURLNodeQuery(String vserver_name) throws AAIServiceException { + + if(vserver_name == null) { + throw new NullPointerException(); + } + + URL entity = null; + SearchResults resp = this.requestNodeQuery("vserver", "vserver-name", vserver_name); + + List<ResultData> resultDataList = resp.getResultData(); + + try { + for (ResultData datum : resultDataList) { + String data_type = datum.getResourceType(); + entity = new URL(datum.getResourceLink()); + } + } catch (Exception e) { + throw new AAIServiceException(e); + } + return entity; + } + + class AAIRequestExecutor implements AAIExecutorInterface { + + @Override + public String get(AAIRequest request) throws AAIServiceException { + String response = null; + InputStream inputStream = null; + HttpURLConnection con = null; + URL requestUrl = null; + + String requestId = UUID.randomUUID().toString(); + + try { + + if(request.getRequestObject() != null) { + requestUrl = request.getRequestUrl(HttpMethod.POST, null); + requestUrl = appendDepth(requestUrl, request); + con = getConfiguredConnection(requestUrl, HttpMethod.POST); + String json_text = request.toJSONString(); + LOGwriteDateTrace("data", json_text); + logMetricRequest(requestId, "POST "+requestUrl.getPath(), json_text, requestUrl.getPath()); + OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); + osw.write(json_text); + osw.flush(); + } else { + requestUrl = request.getRequestUrl(HttpMethod.GET, null); + requestUrl = appendDepth(requestUrl, request); + con = getConfiguredConnection(requestUrl, HttpMethod.GET); + logMetricRequest(requestId, "GET "+requestUrl.getPath(), "", requestUrl.getPath()); + } + + // Check for errors + String responseMessage = con.getResponseMessage(); + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode + " : " + responseMessage); + logMetricResponse(requestId, responseCode, responseMessage); + + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK) { + StringBuilder stringBuilder = new StringBuilder(); + String line = null; + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + response = stringBuilder.toString(); + try { + Object object = mapper.readValue(response, Object.class); + LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, responseMessage, mapper.writeValueAsString(object)); + } catch(Exception exc) { + LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, responseMessage, mapper.writeValueAsString(response)); + } + } else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { + LOGwriteEndingTrace(responseCode, responseMessage, "Entry does not exist."); + ErrorResponse errorresponse = null; + try { + errorresponse = mapper.readValue(reader, ErrorResponse.class); + } catch(Exception exc) { + errorresponse = new ErrorResponse(); + RequestError requestError = new RequestError(); + ServiceException serviceException = new ServiceException(); + serviceException.setText("Entry does not exist."); + requestError.setServiceException(serviceException); + errorresponse.setRequestError(requestError ); + } + throw new AAIServiceException(responseCode, errorresponse); + } else if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) { + StringBuilder stringBuilder = new StringBuilder(); + String line = null; + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, responseMessage, stringBuilder.toString()); + ServiceException serviceException = new ServiceException(); + serviceException.setMessageId("HTTP_UNAUTHORIZED"); + serviceException.setText(stringBuilder.toString()); + RequestError requestError = new RequestError(); + requestError.setServiceException(serviceException); + ErrorResponse errorresponse = new ErrorResponse(); + errorresponse.setRequestError(requestError); + throw new AAIServiceException(responseCode, errorresponse); + } else { +// +// StringBuilder stringBuilder = new StringBuilder("\n"); +// String line = null; +// while( ( line = reader.readLine() ) != null ) { +// stringBuilder.append("\n").append( line ); +// } +// LOG.info(stringBuilder.toString()); +// +// ErrorResponse errorresponse = mapper.readValue(stringBuilder.toString(), ErrorResponse.class); + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, responseMessage, mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("GET", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + private URL appendDepth(URL requestUrl, AAIRequest request) throws MalformedURLException { + + String depth = request.requestProperties.getProperty("depth", "1"); + String path = requestUrl.toString(); + if(path.contains("?depth=") || path.contains("&depth=")) { + return requestUrl; + } else { + if(path.contains("?")) { + path = String.format("%s&depth=%s", path, depth); + } else { + path = String.format("%s?depth=%s", path, depth); + } + return new URL(path); + } + } + + @Override + public String post(AAIRequest request) throws AAIServiceException { + InputStream inputStream = null; + String requestId = UUID.randomUUID().toString(); + + try { + String resourceVersion = null; + AAIDatum instance = request.getRequestObject(); + + Method getResourceVersionMethod = instance.getClass().getMethod("getResourceVersion"); + if(getResourceVersionMethod != null){ + try { + getResourceVersionMethod.setAccessible(true); + Object object = getResourceVersionMethod.invoke(instance); + if(object != null) + resourceVersion = object.toString(); + } catch (InvocationTargetException x) { + Throwable cause = x.getCause(); + } + } + + URL requestUrl = null; + HttpURLConnection con = getConfiguredConnection(requestUrl = request.getRequestUrl(HttpMethod.PUT, resourceVersion), HttpMethod.PUT); + ObjectMapper mapper = getObjectMapper(); + String json_text = request.toJSONString(); + + LOGwriteDateTrace("data", json_text); + logMetricRequest(requestId, "PUT "+requestUrl.getPath(), json_text, requestUrl.getPath()); + + OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); + osw.write(json_text); + osw.flush(); + + // Check for errors + String responseMessage = con.getResponseMessage(); + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + LOG.debug("HttpURLConnection result:" + responseCode + " : " + responseMessage); + logMetricResponse(requestId,responseCode, responseMessage); + + // Process the response + BufferedReader reader; + String line = null; + reader = new BufferedReader( new InputStreamReader( inputStream ) ); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, responseMessage, (stringBuilder != null) ? stringBuilder.toString() : "{no-data}"); + return stringBuilder.toString(); + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, responseMessage, mapper.writeValueAsString(errorresponse)); + + throw new AAIServiceException(responseCode, errorresponse); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("AAIRequestExecutor.post", exc); + throw new AAIServiceException(exc); + } finally { + try { + if(inputStream != null) + inputStream.close(); + } catch (Exception exc) { + + } + } + } + + @Override + public Boolean delete(AAIRequest request, String resourceVersion) throws AAIServiceException { + Boolean response = null; + InputStream inputStream = null; + String requestId = UUID.randomUUID().toString(); + + if(resourceVersion == null) { + throw new AAIServiceException("resource-version is required for DELETE request"); + } + + try { + URL requestUrl = null; + HttpURLConnection conn = getConfiguredConnection(requestUrl = request.getRequestUrl(HttpMethod.DELETE, resourceVersion), HttpMethod.DELETE); + logMetricRequest(requestId, "DELETE "+requestUrl.getPath(), "", requestUrl.getPath()); + conn.setDoOutput(true); +// if(request.isDeleteDataRequired()) { +// String json_text = request.toJSONString(); +// +// LOGwriteDateTrace("data", json_text); +// OutputStream os = con.getOutputStream(); +// OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); +// osw.write(json_text); +// osw.flush(); +// } + + // Check for errors + String responseMessage = conn.getResponseMessage(); + int responseCode = conn.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = conn.getInputStream(); + } else { + inputStream = conn.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode + " : " + responseMessage); + logMetricResponse(requestId,responseCode, responseMessage); + + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + String line = null; + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, responseMessage, stringBuilder.toString()); + response = true; + } else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) { + LOGwriteEndingTrace(responseCode, responseMessage, "Entry does not exist."); + response = false; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, responseMessage, mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("delete", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + @Override + public Object query(AAIRequest request, Class clas) throws AAIServiceException { + Object response = null; + InputStream inputStream = null; + HttpURLConnection con = null; + URL requestUrl = null; + String requestId = UUID.randomUUID().toString(); + + try { + con = getConfiguredConnection(requestUrl = request.getRequestQueryUrl(HttpMethod.GET), HttpMethod.GET); + logMetricRequest(requestId, "GET "+requestUrl.getPath(), "", requestUrl.getPath()); + + // Check for errors + String responseMessage = con.getResponseMessage(); + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + logMetricResponse(requestId,responseCode, responseMessage); + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK) { + // Process the response + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + response = mapper.readValue(reader, clas); + LOGwriteEndingTrace(HttpURLConnection.HTTP_OK, "SUCCESS", mapper.writeValueAsString(response)); + } else if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + return response; + } else { + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("GET", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + con = null; + } + return response; + } + + @Override + public Boolean patch(AAIRequest request, String resourceVersion) throws AAIServiceException { + InputStream inputStream = null; + String requestId = UUID.randomUUID().toString(); + + try { + AAIDatum instance = request.getRequestObject(); + if(instance instanceof ResourceVersion) { + resourceVersion = ((ResourceVersion)instance).getResourceVersion(); + } + + URL requestUrl = null; + HttpURLConnection con = getConfiguredConnection(requestUrl = request.getRequestUrl("PATCH", resourceVersion), "PATCH"); + ObjectMapper mapper = getObjectMapper(); + String json_text = request.toJSONString(); + + LOGwriteDateTrace("data", json_text); + logMetricRequest(requestId, "PATCH "+requestUrl.getPath(), json_text, requestUrl.getPath()); + + OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); + osw.write(json_text); + osw.flush(); + + // Check for errors + String responseMessage = con.getResponseMessage(); + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + LOG.info("HttpURLConnection result: " + responseCode + " : " + responseMessage); + logMetricResponse(requestId,responseCode, responseMessage); + + // Process the response + BufferedReader reader; + String line = null; + reader = new BufferedReader( new InputStreamReader( inputStream ) ); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_CREATED || responseCode == HttpURLConnection.HTTP_ACCEPTED || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, responseMessage, (stringBuilder != null) ? stringBuilder.toString() : "{no-data}"); + return true; + } else { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append("\n").append( line ); + } + LOG.info(stringBuilder.toString()); + + + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, responseMessage, mapper.writeValueAsString(errorresponse)); + + throw new AAIServiceException(responseCode, errorresponse); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("AAIRequestExecutor.patch", exc); + throw new AAIServiceException(exc); + } finally { + try { + if(inputStream != null) + inputStream.close(); + } catch (Exception exc) { + + } + } + } + } + + @Override + public Tenant requestTenantData(String tenant_id, String cloudOwner, String cloudRegionId) throws AAIServiceException { + Tenant response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("tenant"); + request.addRequestProperty("tenant.tenant-id", tenant_id); + request.addRequestProperty("cloud-region.cloud-owner", cloudOwner); + request.addRequestProperty("cloud-region.cloud-region-id", cloudRegionId); + + String rv = executor.get(request); + if(rv != null) { + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(rv, Tenant.class); + } + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestTenantData", exc); + throw new AAIServiceException(exc); + } + + return response; + } + + @Override + public Tenant requestTenantDataByName(String tenant_name, String cloudOwner, String cloudRegionId) throws AAIServiceException { + Tenant response = null; + + try { + AAIRequest request = AAIRequest.getRequestFromResource("tenant"); + request.addRequestProperty("tenant.tenant-name", tenant_name); + request.addRequestProperty("cloud-region.cloud-owner", cloudOwner); + request.addRequestProperty("cloud-region.cloud-region-id", cloudRegionId); + Object rv = executor.query(request, Tenant.class); + if(rv == null) + return (Tenant)null; + else + response = (Tenant)rv; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("requestTenantDataByName", exc); + throw new AAIServiceException(exc); + } + + return response; + } + + + @Override + public boolean postTenantData(String tenant_id, String cloudOwner, String cloudRegionId, Tenant tenannt) throws AAIServiceException { + try { + AAIRequest request = AAIRequest.getRequestFromResource("tenant"); + request.addRequestProperty("tenant.tenant-id", tenant_id); + request.addRequestProperty("cloud-region.cloud-owner", cloudOwner); + request.addRequestProperty("cloud-region.cloud-region-id", cloudRegionId); + request.setRequestObject(tenannt); + Object response = executor.post(request); + return true; + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("postTenantData", exc); + throw new AAIServiceException(exc); + } + } + + + @Override + public String getTenantIdFromVserverUrl(URL url) { + + String path = url.getPath(); + + String[] split = path.split("/tenants/tenant/"); + if(split.length > 1) { + split = split[1].split("/"); + return split[0]; + } else { + return null; + } + } + + @Override + public String getCloudOwnerFromVserverUrl(URL url) { + + String path = url.getPath(); + + String[] split = path.split("/cloud-regions/cloud-region/"); + if(split.length > 1) { + split = split[1].split("/"); + return split[0]; + } else { + return null; + } + } + + @Override + public String getCloudRegionFromVserverUrl(URL url) { + + String path = url.getPath(); + + String[] split = path.split("/cloud-regions/cloud-region/"); + if(split.length > 1) { + split = split[1].split("/"); + return split[1]; + } else { + return null; + } + } + + @Override + public String getVServerIdFromVserverUrl(URL url, String tenantId) { + String pattern = network_vserver_path; + pattern = pattern.replace("{tenant-id}", tenantId); + + int end = pattern.indexOf("{vserver-id}"); + String prefix = pattern.substring(0, end); + + String path = url.getPath(); + + if(path.startsWith(prefix)) { + path = path.substring(prefix.length()); + } + + return path; + } + + protected Logger getLogger(){ + return LOG; + } + + + @Override + public AAIRequestExecutor getExecutor() { + return executor; + } + + /** + * Creates a current time stamp in UTC i.e. 2016-03-08T22:15:13.343Z. + * If there are any parameters the values are appended to the time stamp. + * + * @param parameters + * values to be appended to current time stamp + * @param ctx + * used to set an attribute for a DG + * @throws SvcLogicException + */ + public void setStatusMethod(Map<String, String> parameters, SvcLogicContext ctx) throws SvcLogicException { + if (ctx == null) { + throw new SvcLogicException("SvcLogicContext is null."); + } + + StringBuilder sb = new StringBuilder(); + sb.append(String.format("%tFT%<tTZ", Calendar.getInstance(TimeZone.getTimeZone("Z")))).append(" - "); + + for (Entry<String, String> entry : parameters.entrySet()) { + sb.append(entry.getValue()).append(" "); + } + + if (sb.length() > 0) { + sb.setLength(sb.length() - 2); + } + + ctx.setAttribute("aai-summary-status-message", sb.toString()); + LOG.info("aai-summary-status-message: " + sb.toString()); + } + + /** + * Generic method to GET json data from an A&AI using key structure. + * Then convert that json to an Object. + * If successful the Object is attempted to be cast to the type parameter. + * + * @param key + * key identifying the resource to be retrieved from AAI + * @param type + * the class of object that A&AI will return + * @return the object created from json or null if the response code is not 200 + * + * @throws AAIServiceException + * if empty or null key and or type or there's an error with processing + */ + + public <T> T getResource(String key, Class<T> type) throws AAIServiceException { + if (StringUtils.isEmpty(key) || type == null) { + throw new AAIServiceException("Key is empty or null and or type is null"); + } + + T response = null; + + SvcLogicContext ctx = new SvcLogicContext(); + if(!key.contains(" = ")) { + if(isValidURL(key)) { + key = String.format("selflink = '%s'", key); + } else { + return response; + } + } + + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + + AAIRequest request = new SelfLinkRequest(type); + if(nameValues.containsKey(PathRequest.RESOURCE_PATH.replaceAll("-", "_"))) { + request = new PathRequest(type); + } + + request.processRequestPathValues(nameValues); + Object obj = this.getExecutor().query(request, type); + response = type.cast(obj); + + return response != null ? type.cast(response) : response; + } + + public boolean isValidURL(String url) { + + URL u = null; + + try { + u = new URL(url); + } catch (MalformedURLException e) { + return false; + } + + try { + u.toURI(); + } catch (URISyntaxException e) { + return false; + } + + return true; + } + + @Override + protected boolean deleteRelationshipList(URL httpReqUrl, String json_text) throws AAIServiceException { + if(httpReqUrl == null) { + throw new NullPointerException(); + } + + boolean response = false; + InputStream inputStream = null; + + try { + HttpURLConnection con = getConfiguredConnection(httpReqUrl, HttpMethod.DELETE); + +// SSLSocketFactory sockFact = CTX.getSocketFactory(); +// con.setSSLSocketFactory( sockFact ); + OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); + osw.write(json_text); + osw.flush(); + osw.close(); + + + LOGwriteFirstTrace("DELETE", httpReqUrl.toString()); + LOGwriteDateTrace("data", json_text); + + // Check for errors + int responseCode = con.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + inputStream = con.getInputStream(); + } else { + inputStream = con.getErrorStream(); + } + + // Process the response + LOG.debug("HttpURLConnection result:" + responseCode); + if(inputStream == null) inputStream = new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)); + BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) ); + String line = null; + + ObjectMapper mapper = getObjectMapper(); + + if (responseCode == HttpURLConnection.HTTP_OK || responseCode == HttpURLConnection.HTTP_NO_CONTENT) { + StringBuilder stringBuilder = new StringBuilder(); + + while( ( line = reader.readLine() ) != null ) { + stringBuilder.append( line ); + } + LOGwriteEndingTrace(responseCode, "SUCCESS", stringBuilder.toString()); + response = true; + } else if(responseCode == HttpURLConnection.HTTP_NOT_FOUND ) { + LOGwriteEndingTrace(responseCode, "HTTP_NOT_FOUND", "Entry does not exist."); + response = false; + } else { + ErrorResponse errorresponse = mapper.readValue(reader, ErrorResponse.class); + LOGwriteEndingTrace(responseCode, "FAILURE", mapper.writeValueAsString(errorresponse)); + throw new AAIServiceException(responseCode, errorresponse); + } + + } catch(AAIServiceException aaiexc) { + throw aaiexc; + } catch (Exception exc) { + LOG.warn("deleteRelationshipList", exc); + throw new AAIServiceException(exc); + } finally { + if(inputStream != null){ + try { + inputStream.close(); + } catch(Exception exc) { + + } + } + } + return response; + } + + public static ObjectMapper getObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + AnnotationIntrospector introspector = new JaxbAnnotationIntrospector(TypeFactory.defaultInstance()); + AnnotationIntrospector secondary = new JacksonAnnotationIntrospector(); + mapper.setAnnotationIntrospector(AnnotationIntrospector.pair(introspector, secondary)); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + mapper.setSerializationInclusion(Include.NON_NULL); + return mapper; + } + + public void logMetricRequest(String requestId, String targetServiceName, String msg, String path){ + String svcInstanceId = ""; + String svcName = null; + String partnerName = null; + String targetEntity = "A&AI"; + String targetVirtualEntity = null; + + targetServiceName = ""; + + ml.logRequest(svcInstanceId, svcName, partnerName, targetEntity, targetServiceName, targetVirtualEntity, msg); + } + + public void logMetricResponse(String requestId, int responseCode, String responseDescription){ + ml.logResponse(responseCode < 400 ? "SUCCESS" : "FAILURE", Integer.toString(responseCode), responseDescription); + } + + public void logKeyError(String keys){ + LOG.error("Atleast one of the keys [" + keys + "] should have been populated. This will cause a NPE."); + } + + + /** + * Retrofit code + */ + @Override + public QueryStatus save(String resource, boolean force, boolean localOnly, String key, Map<String, String> params, String prefix, SvcLogicContext ctx) + throws SvcLogicException { + String normResource = resource.split(":")[0]; + + switch(normResource){ + case "formatted-query": + case "generic-query": + case "named-query": + case "nodes-query": + case "linterface": + case "l2-bridge-sbg": + case "l2-bridge-bgf": + case "echo": + case "test": + break; + + default: + if(!key.contains(String.format("%s.", normResource))) { + key = rewriteKey(resource, key, ctx); + } + } + return super.save(resource, force, localOnly, key, params, prefix, ctx); + } + + @Override + public QueryStatus query(String resource, boolean localOnly, String select, String key, String prefix, String orderBy, SvcLogicContext ctx) + throws SvcLogicException { + String normResource = resource.split(":")[0]; + + switch(normResource){ + case "formatted-query": + case "generic-query": + case "named-query": + case "nodes-query": + case "linterface": + case "l2-bridge-sbg": + case "l2-bridge-bgf": + case "echo": + case "test": + break; + + default: + if(!key.contains(String.format("%s.", normResource))) { + key = rewriteKey(resource, key, ctx); + } + } + + return super.query(resource, localOnly, select, key, prefix, orderBy, ctx); + } + + @Override + public QueryStatus delete(String resource, String key, SvcLogicContext ctx) throws SvcLogicException { + String normResource = resource.split(":")[0]; + + switch(normResource){ + case "formatted-query": + case "generic-query": + case "named-query": + case "nodes-query": + case "linterface": + case "l2-bridge-sbg": + case "l2-bridge-bgf": + case "echo": + case "test": + break; + + default: + if(!key.contains(String.format("%s.", normResource))) { + key = rewriteKey(resource, key, ctx); + } + } + + return super.delete(resource, key, ctx); + } + + @Override + public QueryStatus update(String resource, String key, Map<String, String> params, String prefix, SvcLogicContext ctx) throws SvcLogicException { + String normResource = resource.split(":")[0]; + + switch(normResource){ + case "formatted-query": + case "generic-query": + case "named-query": + case "nodes-query": + case "linterface": + case "l2-bridge-sbg": + case "l2-bridge-bgf": + case "echo": + case "test": + break; + + default: + if(!key.contains(String.format("%s.", normResource))) { + key = rewriteKey(resource, key, ctx); + } + } + + return super.update(resource, key, params, prefix, ctx); + } + + private String rewriteKey(String resource, String key, SvcLogicContext ctx) { + LOG.info("AAI Deprecation - the format of request key is no longer supported. Please rewrite this key : " + key); + + String normResource = resource.split(":")[0]; + Class<? extends AAIDatum> clazz = null; + try { + clazz = AAIRequest.getClassFromResource(normResource) ; + } catch (ClassNotFoundException e) { + LOG.warn("AAIRequest does not support class: " + e.getMessage()); + return key; + } + if(clazz == null) + return key; + + List<String> fieldAnnotatedNames = new LinkedList<String>(); + + Field[] fields = clazz.getDeclaredFields(); + for(Field field : fields) { + String fieldName = field.getName(); + XmlElement annotation = field.getAnnotation(XmlElement.class); + if(annotation == null) + continue; + String primaryId = annotation.name(); + if("##default".equals(primaryId)) { + primaryId = fieldName; + } + fieldAnnotatedNames.add(primaryId); + } + + HashMap<String, String> nameValues = keyToHashMap(key, ctx); + Set<String> keyset = nameValues.keySet(); + for(String keyName : keyset) { + if(keyName.contains(".")) + continue; + else { + String tmpKeyName = keyName.replaceAll("_", "-"); + if(fieldAnnotatedNames.contains(tmpKeyName)) { + key = key.replace(tmpKeyName, String.format("%s.%s", normResource, tmpKeyName)); + } + } + } + + + return key; + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIServiceActivator.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIServiceActivator.java new file mode 100644 index 00000000..28887738 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIServiceActivator.java @@ -0,0 +1,239 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; + +import org.onap.ccsdk.sli.core.sli.ConfigurationException; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AAIServiceActivator implements BundleActivator { + + private static final String DEFAULT_CONFIG_FILE_NAME = "aaiclient.config"; + private static final String DEFAULT_PROPERTY_FILE_NAME = "aaiclient.properties"; + private static final String DEFAULT_KEYWORD = "default"; + + private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR"; + + private static final String BVC_PROPERTY_FILE = "/opt/bvc/controller/configuration/aaiclient.properties"; + private static final String DEFAULT_SDNC_PROPERTY_FILE = "/opt/sdnc/data/properties/aaiclient.properties"; + + private Set<ServiceRegistration> registrationSet = new HashSet<ServiceRegistration>(); + + private static final Logger LOG = LoggerFactory.getLogger(AAIServiceActivator.class); + + @Override + public void start(BundleContext ctx) throws Exception { + + System.setProperty("aaiclient.runtime", "OSGI"); + + String sdnConfigDirectory = System.getenv(SDNC_CONFIG_DIR); + + // check SDNC CONFIG DIR system property + if(sdnConfigDirectory == null ) { + LOG.error("System property SDNC_CONFIG_DIR is not defined."); + LOG.info("Defaulting SDNC_CONFIG_DIR to '/opt/sdnc/data/properties/'"); + sdnConfigDirectory = "/opt/sdnc/data/properties/"; + } + + LOG.debug("Configuration directory used : " + sdnConfigDirectory); + + // check existance of properties directory + File configDirectory = new File(sdnConfigDirectory); + if(!configDirectory.exists() || !configDirectory.isDirectory()){ + LOG.error("System property SDNC_CONFIG_DIR = '" + sdnConfigDirectory + "' does not point to a valid directory. AAIService will not be initialized."); + return; + } + + Properties properties = new Properties(); + InputStream input = null; + + // find aaiclient config file + File[] files = findFiles(configDirectory, DEFAULT_CONFIG_FILE_NAME); + + // read the aai config data + if(files != null && files.length > 0) { + LOG.debug("AAIService config file exists and it is named :" + files[0].getAbsolutePath() ); + try { + input = new FileInputStream(files[0]); + properties.load(input); + LOG.debug("Loaded AAI Client properties from " + files[0].getAbsolutePath()); + } catch (IOException exc) { + LOG.warn("Problem loading AAI Client properties from " + files[0].getAbsolutePath(), exc); + } finally { + if(input != null ) { + try { + input.close(); + } catch(Exception exc) { + // ignore + } + } + int size = properties.keySet().size() ; + if(size == 0) { + LOG.debug(files[0].getAbsolutePath() + " contained no entries. Adding the default entry"); + properties.put(DEFAULT_KEYWORD, DEFAULT_PROPERTY_FILE_NAME); + } + } + } else { + LOG.debug("No configuration entries were found. Adding the default entry"); + properties.put(DEFAULT_KEYWORD, DEFAULT_PROPERTY_FILE_NAME); + } + + Set<String> entrySet = properties. stringPropertyNames(); + String value = null; + + // initialize AAI Service for each aai client property files + for(String entry : entrySet) { + value = properties.getProperty(entry); + if(value != null && !value.isEmpty()) { + + final String fileName = value; + + File[] propertyFileList = findFiles(configDirectory, fileName); + + for(File propertiesFile : propertyFileList) { + LOG.info(propertiesFile.getName()); + // Advertise AAI resource adaptor + AAIClient impl = null; + switch(entry) { + case DEFAULT_KEYWORD: + impl = new AAIService(propertiesFile.toURI().toURL()); + break; + case "trinity": + impl = new AAITrinityService(propertiesFile.toURI().toURL()); + break; + default: + LOG.error("Invalid configuration keyword '"+entry+"' detected in aaiclient.config. Aborting initialization"); + continue; + } + String regName = impl.getClass().getName(); + + LOG.debug("Registering AAIService service "+regName); + ServiceRegistration registration = ctx.registerService(regName, impl, null); + registrationSet.add(registration); + + } + } + } + } + +// @Override + @Deprecated + public void start1(BundleContext ctx) throws Exception { + + String sdnConfigDirectory = System.getenv(SDNC_CONFIG_DIR); + String propertiesPath = null; + + if (sdnConfigDirectory == null || sdnConfigDirectory.isEmpty()) { + String filename = DEFAULT_SDNC_PROPERTY_FILE; + File file = new File(filename); + if(file != null && file.exists()) { + propertiesPath = filename; + LOG.info("Using property file (1): " + propertiesPath); + } else { + filename = BVC_PROPERTY_FILE; + file = new File(filename); + if(file != null && file.exists()) { + propertiesPath = filename; + LOG.info("Using property file (1): " + propertiesPath); + } else { + throw new ConfigurationException("Cannot find config file - "+filename+" and "+SDNC_CONFIG_DIR+" is unset"); + } + } + } else { + propertiesPath = sdnConfigDirectory + "/aaiclient.properties"; + LOG.info("Environment variable " + SDNC_CONFIG_DIR + " set, - calculated path " + propertiesPath); + } + + File propFile = new File(propertiesPath); + if(!propFile.exists()) { + String filename = DEFAULT_SDNC_PROPERTY_FILE; + File file = new File(filename); + if(file != null && file.exists()) { + propertiesPath = filename; + LOG.info("Using property file (1): " + propertiesPath); + } else { + filename = BVC_PROPERTY_FILE; + file = new File(filename); + if(file != null && file.exists()) { + propertiesPath = filename; + LOG.info("Using property file (1): " + propertiesPath); + } else { + LOG.error("AnAI Service Property file " + propertiesPath + "does not exist."); + throw new ConfigurationException("Cannot find config file - "+propertiesPath+" and " + SDNC_CONFIG_DIR + " is unset."); + } + } + } + + // Advertise AAI resource adaptor + AAIClient impl = new AAIService(propFile.toURI().toURL()); + String regName = impl.getClass().getName(); + + LOG.debug("Registering AAIService service "+regName); + ServiceRegistration registration = ctx.registerService(regName, impl, null); + registrationSet.add(registration); + } + + @Override + public void stop(BundleContext ctx) throws Exception { + + Set<ServiceRegistration> localRegistrationSet = new HashSet<ServiceRegistration>(); + localRegistrationSet.addAll(registrationSet); + + for(ServiceRegistration registration : localRegistrationSet) { + if (registration != null) { + try { + AAIService aaiService = (AAIService)ctx.getService(registration.getReference()); + registration.unregister(); + registrationSet.remove(registration); + if(aaiService != null) { + aaiService.cleanUp(); + } + } catch(Exception exc) { + if(LOG.isDebugEnabled()) + LOG.debug(exc.getMessage()); + } + } + } + } + + private File[] findFiles(File configDirectory, final String filter) { + File[] files = configDirectory.listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.equalsIgnoreCase(filter); + } + }); + + return files; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIServiceException.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIServiceException.java new file mode 100644 index 00000000..cda60a8c --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAIServiceException.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import org.openecomp.sdnc.sli.aai.data.ErrorResponse; + +public class AAIServiceException extends Exception { + + /** + * + */ + private static final long serialVersionUID = -9039257722542999522L; + + protected ErrorResponse errorResponse = null; + protected int returnCode = -1; + + public AAIServiceException() { + + } + + public AAIServiceException(String message) { + super(message); + } + + public AAIServiceException(Throwable cause) { + super(cause); + } + + public AAIServiceException(String message, Throwable cause) { + super(message, cause); + } + + public AAIServiceException(String message, Throwable cause, + boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + + public AAIServiceException(int returnCode, ErrorResponse errorresponse) { + this.errorResponse = errorresponse; + this.returnCode = returnCode; + } + + public ErrorResponse getErrorResponse() { + return errorResponse; + } + + public int getReturnCode() { + return returnCode; + } + + public String getMessage() { + if(errorResponse != null) { + return errorResponse.getRequestError().getServiceException().getText(); + } else { + return super.getMessage(); + } + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAITrinityService.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAITrinityService.java new file mode 100644 index 00000000..ed5295cf --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/AAITrinityService.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.net.URL; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AAITrinityService extends AAIService { + + private static final Logger LOG = LoggerFactory.getLogger(AAITrinityService.class); + + public AAITrinityService(URL propURL) { + super(propURL); + LOG.info("Entered AAITrinityService.ctor"); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/CloudRegionRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/CloudRegionRequest.java new file mode 100644 index 00000000..08c86a27 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/CloudRegionRequest.java @@ -0,0 +1,135 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.CloudRegion; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Joiner; + +public class CloudRegionRequest extends AAIRequest { + + public static final String CLOUD_REGION_PATH = "org.openecomp.sdnc.sli.aai.path.cloud.region"; + + private final String cloud_region_path; + + public static final String CLOUD_REGION_CLOUD_OWNER = "cloud-region.cloud-owner"; + public static final String CLOUD_REGION_CLOUD_REGION_ID = "cloud-region.cloud-region-id"; + + + public CloudRegionRequest() { + cloud_region_path = configProperties.getProperty(CLOUD_REGION_PATH); + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+cloud_region_path; + + request_url = processPathData(request_url, requestProperties); + + Map<String, String> query = new HashMap<String, String>(); + if(requestProperties.containsKey(DEPTH)) { + query.put(DEPTH, requestProperties.getProperty(DEPTH)); + } + + if(resourceVersion != null) { +// request_url = request_url +"?resource-version="+resourceVersion; + query.put(RESOURCE_VERSION, resourceVersion); + } + + if(!query.isEmpty()) { + Joiner.MapJoiner mapJoiner = Joiner.on("&").withKeyValueSeparator("="); + String queryString = mapJoiner.join(query); + request_url = String.format("%s?%s", request_url, queryString); + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + CloudRegion vnfc = (CloudRegion)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vnfc); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = + { + CLOUD_REGION_CLOUD_OWNER, + CLOUD_REGION_CLOUD_REGION_ID, + DEPTH + }; + + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return CloudRegion.class; + } + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + + if(!requestProperties.containsKey(CLOUD_REGION_CLOUD_OWNER) || !requestProperties.containsKey(CLOUD_REGION_CLOUD_REGION_ID)) { + aaiService.logKeyError(String.format("%s,%s", CLOUD_REGION_CLOUD_OWNER, CLOUD_REGION_CLOUD_REGION_ID)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(CLOUD_REGION_CLOUD_OWNER)); + request_url = request_url.replace("{cloud-owner}", encoded_vnf) ; + + encoded_vnf = encodeQuery(requestProperties.getProperty(CLOUD_REGION_CLOUD_REGION_ID)); + request_url = request_url.replace("{cloud-region-id}", encoded_vnf) ; + + aaiService.LOGwriteDateTrace("cloud-owner", requestProperties.getProperty(CLOUD_REGION_CLOUD_OWNER)); + aaiService.LOGwriteDateTrace("cloud-region-id", requestProperties.getProperty(CLOUD_REGION_CLOUD_REGION_ID)); + + return request_url; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/CustomQueryRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/CustomQueryRequest.java new file mode 100644 index 00000000..d61a4ea8 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/CustomQueryRequest.java @@ -0,0 +1,134 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.openecomp.sdnc.sli.aai.query.FormattedQueryRequestData; +import org.openecomp.sdnc.sli.aai.query.FormattedQueryResultList; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + + +public class CustomQueryRequest extends AAIRequest { + + public static final String GENERIC_SEARCH_PATH = "org.openecomp.sdnc.sli.aai.query.generic"; + + private final String generic_search_path; + + public static final String FORMAT = "format"; + + + public CustomQueryRequest() { + String tmp_generic_search_path = configProperties.getProperty(GENERIC_SEARCH_PATH); + tmp_generic_search_path = tmp_generic_search_path.split("search")[0]; + generic_search_path = tmp_generic_search_path +"query"; + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+generic_search_path; + + request_url = processPathData(request_url, requestProperties); + + String formatQuery = requestProperties.getProperty(FORMAT); + + if(formatQuery != null) { + request_url = request_url +"?format="+formatQuery; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + FormattedQueryRequestData tenant = (FormattedQueryRequestData)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(tenant); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {FORMAT}; + return args; + } + + + @Override + public Class<? extends AAIDatum> getModelClass() { + return FormattedQueryRequestData.class; + } + + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + + String key = FORMAT; + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{identifier}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("identifier", requestProperties.getProperty(key)); + + return request_url; + } + + public AAIDatum jsonStringToObject(String jsonData) throws JsonParseException, JsonMappingException, IOException { + if(jsonData == null) { + return null; + } + + AAIDatum response = null; + ObjectMapper mapper = getObjectMapper(); + response = mapper.readValue(jsonData, FormattedQueryResultList.class); + return response; + } + + protected boolean expectsDataFromPUTRequest() { + return true; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/EchoRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/EchoRequest.java new file mode 100644 index 00000000..7352c402 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/EchoRequest.java @@ -0,0 +1,93 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.openecomp.sdnc.sli.aai.data.EchoResponse; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class EchoRequest extends AAIRequest { + + + + private final String echo_path; + + public EchoRequest() { + echo_path = "/aai/util/echo"; + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+echo_path; + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + EchoResponse tenant = (EchoResponse)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(tenant); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {}; + return args; + } + + + @Override + public Class<? extends AAIDatum> getModelClass() { + return EchoResponse.class; + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericQueryRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericQueryRequest.java new file mode 100644 index 00000000..0f1dda0e --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericQueryRequest.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.ResultData; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class GenericQueryRequest extends AAIRequest { + + public static final String GENERIC_SEARCH_PATH = "org.openecomp.sdnc.sli.aai.query.generic"; + + private final String generic_search_path; + + public static final String START_NODE_TYPE = "start-node-type"; + public static final String IDENTIFIER = "identifier"; + public static final String VALUE = "value"; + + + public GenericQueryRequest() { + generic_search_path = configProperties.getProperty(GENERIC_SEARCH_PATH); + } + + +// @Override +// public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { +// +// String request_url = target_uri+generic_search_path; +// String key = START_NODE_TYPE; +// +// String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); +// request_url = request_url.replace("{vnf-id}", encoded_vnf) ; +// +// if(resourceVersion != null) { +// request_url = request_url +"?resource-version="+resourceVersion; +// } +// URL http_req_url = new URL(request_url); +// +// aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); +// +// +// return http_req_url; +// } + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+generic_search_path; + + request_url = processPathData(request_url, requestProperties); + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + ResultData tenant = (ResultData)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(tenant); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {START_NODE_TYPE, IDENTIFIER, VALUE}; + return args; + } + + + @Override + public Class<? extends AAIDatum> getModelClass() { + return ResultData.class; + } + + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + + String key = IDENTIFIER; + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{identifier}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("identifier", requestProperties.getProperty(key)); + + key = VALUE; + + encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{value}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("value", requestProperties.getProperty(key)); + + key = START_NODE_TYPE; + + encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{start-node-type}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("start-node-type", requestProperties.getProperty(key)); + + return request_url; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericRequest.java new file mode 100644 index 00000000..0da40abe --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericRequest.java @@ -0,0 +1,319 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import javax.xml.bind.annotation.XmlElement; + +import org.openecomp.aai.inventory.v10.L3Network; +import org.openecomp.aai.inventory.v10.L3Networks; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Joiner; + +public class GenericRequest extends AAIRequest { + + + protected Class<? extends AAIDatum> model; + + public GenericRequest(Class<? extends AAIDatum> clazz) { + model = clazz; + } + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = null; + String originalPath = null; + String pathSubstitute = null; + + request_url = target_uri + getRequestPath(); + + Map<String, String> queryParams = new HashMap<String, String> (); + if(resourceVersion != null) { + queryParams.put("resource-version",resourceVersion); + } + + Set<String> uniqueResources = extractUniqueResourceSetFromKeys(requestProperties.stringPropertyNames()); + + String[] keys = requestProperties.keySet().toArray(new String[0]); + for(String key : keys) { + if("cloud-region.cloud-region-id".equals(key)) + continue; + if("entitlement.resource-uuid".equals(key)) + continue; + if("license.resource-uuid".equals(key)) + continue; + + + String value = requestProperties.getProperty(key); + if(key.contains(".")) { + String[] splitKey = key.split("\\."); + if("cloud-region".equals(splitKey[0])){ + String cloudRegionId = requestProperties.getProperty("cloud-region.cloud-region-id"); + aaiService.LOGwriteDateTrace("cloud-region-id", cloudRegionId); + String token = String.format("%s/{%s}/{cloud-region-id}", splitKey[0], splitKey[1] ); + String encoded_owner = encodeQuery(value); + String encoded_region = encodeQuery(cloudRegionId); + request_url = request_url.replace(token, String.format("%s/%s/%s", splitKey[0], encoded_owner, encoded_region)); + } else if("entitlement".equals(splitKey[0])){ + String cloudRegionId = requestProperties.getProperty("entitlement.resource-uuid"); + aaiService.LOGwriteDateTrace("resource-uuid", cloudRegionId); + String token = String.format("%s/{%s}/{resource-uuid}", splitKey[0], splitKey[1] ); + String encoded_owner = encodeQuery(value); + String encoded_region = encodeQuery(cloudRegionId); + request_url = request_url.replace(token, String.format("%s/%s/%s", splitKey[0], encoded_owner, encoded_region)); + } else if("license".equals(splitKey[0])){ + String cloudRegionId = requestProperties.getProperty("license.resource-uuid"); + aaiService.LOGwriteDateTrace("resource-uuid", cloudRegionId); + String token = String.format("%s/{%s}/{resource-uuid}", splitKey[0], splitKey[1] ); + String encoded_owner = encodeQuery(value); + String encoded_region = encodeQuery(cloudRegionId); + request_url = request_url.replace(token, String.format("%s/%s/%s", splitKey[0], encoded_owner, encoded_region)); + } else { + Class<? extends AAIDatum> clazz = null; + try { + clazz = getClassFromResource(splitKey[0]); + } catch (ClassNotFoundException exc) { + LOG.warn("AAIRequest does not support class: " + exc.getMessage()); + return null; + } + + if(clazz != null) { + if(clazz == this.model) { + Field[] fields = this.model.getDeclaredFields(); + Field field = fields[0]; + String fieldName = field.getName(); + XmlElement annotation = field.getAnnotation(XmlElement.class); + String primaryId = annotation.name(); + if("##default".equals(primaryId)) { + primaryId = fieldName; + } + + String token = String.format("%s/{%s}", splitKey[0], primaryId); + + if(splitKey[1].equals(primaryId)) { + String encoded_vnf = encodeQuery(value); + request_url = request_url.replace(token, String.format("%s/%s", splitKey[0], encoded_vnf)); + } else { + queryParams.put(splitKey[1], encodeQuery(value)); + originalPath = token; + pathSubstitute = String.format("%s", splitKey[0]); + } + } else if(L3Networks.class == this.model) { + Field[] fields = L3Network.class.getDeclaredFields(); + Field field = fields[0]; + String fieldName = field.getName(); + XmlElement annotation = field.getAnnotation(XmlElement.class); + String primaryId = annotation.name(); + if("##default".equals(primaryId)) { + primaryId = fieldName; + } + + String token = String.format("%s/{%s}", splitKey[0], primaryId); + originalPath = token; + pathSubstitute = String.format(""); + + queryParams.put(splitKey[1], encodeQuery(value)); + } else { + String token = String.format("%s/{%s}", splitKey[0], splitKey[1]); + String encoded_vnf = encodeQuery(value); + request_url = request_url.replace(token, String.format("%s/%s", splitKey[0], encoded_vnf)); + } + } + + } + aaiService.LOGwriteDateTrace(splitKey[1], value); + } + } + + if(originalPath != null && pathSubstitute != null) + request_url = request_url.replace(originalPath, pathSubstitute); + + if(!queryParams.isEmpty()) { + Joiner.MapJoiner mapJoiner = Joiner.on("&").withKeyValueSeparator("="); + String queryString = mapJoiner.join(queryParams); + request_url = String.format("%s?%s", request_url, queryString); + } + + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + + return http_req_url; + } + + + public URL OriginalgetRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = null; + + request_url = target_uri + getRequestPath(); + + Map<String, String> keyValuepairs = new HashMap<String, String> (); + Set<String> uniqueResources = extractUniqueResourceSetFromKeys(requestProperties.stringPropertyNames()); + + String[] keys = requestProperties.keySet().toArray(new String[0]); + for(String key : keys) { + if("cloud-region.cloud-region-id".equals(key)) + continue; + if("entitlement.resource-uuid".equals(key)) + continue; + if("license.resource-uuid".equals(key)) + continue; + + + String value = requestProperties.getProperty(key); + if(key.contains(".")) { + String[] splitKey = key.split("\\."); + if("cloud-region".equals(splitKey[0])){ + String cloudRegionId = requestProperties.getProperty("cloud-region.cloud-region-id"); + aaiService.LOGwriteDateTrace("cloud-region-id", cloudRegionId); + String token = String.format("%s/{%s}/{cloud-region-id}", splitKey[0], splitKey[1] ); + String encoded_owner = encodeQuery(value); + String encoded_region = encodeQuery(cloudRegionId); + request_url = request_url.replace(token, String.format("%s/%s/%s", splitKey[0], encoded_owner, encoded_region)); + } else if("entitlement".equals(splitKey[0])){ + String cloudRegionId = requestProperties.getProperty("entitlement.resource-uuid"); + aaiService.LOGwriteDateTrace("resource-uuid", cloudRegionId); + String token = String.format("%s/{%s}/{resource-uuid}", splitKey[0], splitKey[1] ); + String encoded_owner = encodeQuery(value); + String encoded_region = encodeQuery(cloudRegionId); + request_url = request_url.replace(token, String.format("%s/%s/%s", splitKey[0], encoded_owner, encoded_region)); + } else if("license".equals(splitKey[0])){ + String cloudRegionId = requestProperties.getProperty("license.resource-uuid"); + aaiService.LOGwriteDateTrace("resource-uuid", cloudRegionId); + String token = String.format("%s/{%s}/{resource-uuid}", splitKey[0], splitKey[1] ); + String encoded_owner = encodeQuery(value); + String encoded_region = encodeQuery(cloudRegionId); + request_url = request_url.replace(token, String.format("%s/%s/%s", splitKey[0], encoded_owner, encoded_region)); + } else { + Class<? extends AAIDatum> clazz = null; + try { + clazz = getClassFromResource(splitKey[0]); + } catch (ClassNotFoundException exc) { + LOG.warn("AAIRequest does not support class: " + exc.getMessage()); + return null; + } + + if(clazz != null) { + if(clazz == this.model) { + Field[] fields = this.model.getDeclaredFields(); + Field field = fields[0]; + String fieldName = field.getName(); + XmlElement annotation = field.getAnnotation(XmlElement.class); + String primaryId = annotation.name(); + if("##default".equals(primaryId)) { + primaryId = fieldName; + } + + String token = String.format("%s/{%s}", splitKey[0], primaryId); + + if(splitKey[1].equals(primaryId)) { + String encoded_vnf = encodeQuery(value); + request_url = request_url.replace(token, String.format("%s/%s", splitKey[0], encoded_vnf)); + } else { + String replacement = String.format("%s?%s=%s", splitKey[0], splitKey[1], encodeQuery(value)); + if(request_url.contains(token)) + request_url = request_url.replace(token, replacement); + } + } else { + String token = String.format("%s/{%s}", splitKey[0], splitKey[1]); + String encoded_vnf = encodeQuery(value); + request_url = request_url.replace(token, String.format("%s/%s", splitKey[0], encoded_vnf)); + } + } + + } + aaiService.LOGwriteDateTrace(splitKey[1], value); + } + } + + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + + String json_text = null; + try { + json_text = mapper.writeValueAsString(requestDatum); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = {}; + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return model; + } + + public void processRequestPathValues(Map<String, String> nameValues) { + // identify unique resources + Set<String> uniqueResources = AAIRequest.extractUniqueResourceSetFromKeys(nameValues.keySet()); + + String[] arguments = nameValues.keySet().toArray(new String[0]); + for(String name : arguments) { + String tmpName = name.replaceAll("-", "_"); + String value = nameValues.get(tmpName); + if(value != null && !value.isEmpty()) { + value = value.trim().replace("'", "").replace("$", "").replace("'", ""); + tmpName = name.replaceAll("_", "-"); + this.addRequestProperty(tmpName, value); + } + } + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericVnfRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericVnfRequest.java new file mode 100644 index 00000000..f8c9a18b --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/GenericVnfRequest.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.GenericVnf; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class GenericVnfRequest extends AAIRequest { + + // tenant (1602) + public static final String GENERIC_VNF_PATH = "org.openecomp.sdnc.sli.aai.path.generic.vnf"; + public static final String GENERIC_VNF_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.generic.vnf.query"; + + private final String generic_vnf_path; + private final String generic_vnf_query_path; + + public static final String GENERIC_VNF_ID = "generic_vnf.vnf_id"; + public static final String VNF_ID = "vnf_id"; + + + public GenericVnfRequest() { + generic_vnf_path = configProperties.getProperty(GENERIC_VNF_PATH); + generic_vnf_query_path = configProperties.getProperty(GENERIC_VNF_QUERY_PATH); + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+generic_vnf_path; + String key = VNF_ID; + if(requestProperties.containsKey(GENERIC_VNF_ID)) { + key = GENERIC_VNF_ID; + } + + if(!requestProperties.containsKey(key)) { + aaiService.logKeyError(String.format("%s,%s", VNF_ID, GENERIC_VNF_ID)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{vnf-id}", encoded_vnf) ; + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + aaiService.LOGwriteDateTrace("vnf-id", requestProperties.getProperty(key)); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+generic_vnf_path; + + String key = VNF_ID; + if(requestProperties.containsKey(GENERIC_VNF_ID)) { + key = GENERIC_VNF_ID; + } + + if(!requestProperties.containsKey(key)) { + aaiService.logKeyError(String.format("%s,%s", VNF_ID, GENERIC_VNF_ID)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{vnf-id}", encoded_vnf) ; + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + aaiService.LOGwriteDateTrace("vnf-id", requestProperties.getProperty(key)); + + return http_req_url; + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + GenericVnf tenant = (GenericVnf)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(tenant); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {VNF_ID, GENERIC_VNF_ID}; + return args; + } + + + @Override + public Class<? extends AAIDatum> getModelClass() { + return GenericVnf.class; + } + + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + + String key = VNF_ID; + if(requestProperties.containsKey(GENERIC_VNF_ID)) { + key = GENERIC_VNF_ID; + } + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{vnf-id}", encoded_vnf) ; + + return request_url; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/L3InterfaceIpv4AddressListRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/L3InterfaceIpv4AddressListRequest.java new file mode 100644 index 00000000..762d43bb --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/L3InterfaceIpv4AddressListRequest.java @@ -0,0 +1,212 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.L3InterfaceIpv4AddressList; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class L3InterfaceIpv4AddressListRequest extends AAIRequest { + + /* + * Note: there are 3 possible paths: + * /aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * /aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * /aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * /aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + * aaiv7:inventory/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + */ + + public static final String L3_INTERFACE_IPV4_ADDRESS_LIST_PATH = "org.openecomp.sdnc.sli.aai.path.l3.interface.ipv4.address.list"; + public static final String VLAN_L3_INTERFACE_IPV4_ADDRESS_LIST_PATH = "org.openecomp.sdnc.sli.aai.path.vlan.l3.interface.ipv4.address.list"; + + private final String l3_interface_ipv4_address_list_path; + private final String vlan_l3_interface_ipv4_address_list_path; + + public static final String L3_INTERFACE_IPV4_ADDRESS = "l3-interface-ipv4-address"; + public static final String LIST_L3_INTERFACE_IPV4_ADDRESS = "l3-interface-ipv4-address-list.l3-interface-ipv4-address"; + public static final String VLAN_INTERFACE = "vlan-interface"; + public static final String VLAN_VLAN_INTERFACE = "vlan.vlan-interface"; + + public L3InterfaceIpv4AddressListRequest() { + l3_interface_ipv4_address_list_path = configProperties.getProperty(L3_INTERFACE_IPV4_ADDRESS_LIST_PATH); + vlan_l3_interface_ipv4_address_list_path = configProperties.getProperty(VLAN_L3_INTERFACE_IPV4_ADDRESS_LIST_PATH); + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+l3_interface_ipv4_address_list_path; + + if(requestProperties.containsKey(VLAN_INTERFACE) || requestProperties.containsKey(VLAN_VLAN_INTERFACE)){ + request_url = target_uri+vlan_l3_interface_ipv4_address_list_path; + request_url = processVLanRequestPathData(request_url, requestProperties); + } + + request_url = processPathData(request_url, requestProperties); + request_url = LInterfaceRequest.processPathData(request_url, requestProperties); +// request_url = GenericVnfRequest.processPathData(request_url, requestProperties); + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + public static String processVLanRequestPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + String key = null; + + if(requestProperties.containsKey(VLAN_VLAN_INTERFACE)) { + key = VLAN_VLAN_INTERFACE; + } else if(requestProperties.containsKey(VLAN_INTERFACE)) { + key = VLAN_INTERFACE; + } else { + aaiService.logKeyError(String.format("%s,%s", VLAN_INTERFACE, VLAN_VLAN_INTERFACE)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + + request_url = request_url.replace("{vlan-interface}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("vlan-interface", requestProperties.getProperty(key)); + return request_url; + } + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + L3InterfaceIpv4AddressList vnfc = (L3InterfaceIpv4AddressList)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vnfc); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = + { + L3_INTERFACE_IPV4_ADDRESS, + LIST_L3_INTERFACE_IPV4_ADDRESS, + VLAN_INTERFACE, + VLAN_VLAN_INTERFACE, + LInterfaceRequest.INTERFACE_NAME, + LInterfaceRequest.LINTERFACE_INTERFACE_NAME, + "generic-vnf.vnf-id" + }; + + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return L3InterfaceIpv4AddressList.class; + } + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + String key = L3_INTERFACE_IPV4_ADDRESS; + if(requestProperties.containsKey(LIST_L3_INTERFACE_IPV4_ADDRESS)) { + key = LIST_L3_INTERFACE_IPV4_ADDRESS; + } + + if(!requestProperties.containsKey(key)) { + aaiService.logKeyError(String.format("%s,%s", L3_INTERFACE_IPV4_ADDRESS, LIST_L3_INTERFACE_IPV4_ADDRESS)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + + request_url = request_url.replace("{l3-interface-ipv4-address}", encoded_vnf) ; + + aaiService.LOGwriteDateTrace("l3-interface-ipv4-address", requestProperties.getProperty(key)); + return request_url; + } + + /* + * (non-Javadoc) + * @see org.openecomp.sdnc.sli.aai.PathConfigurator#configurePath(java.lang.String) + */ +// @Override +// public void processRequestPathValues(Map<String, String> nameValues) { +// String[] paths = +// { +// "/aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address}", +// "/aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address}", +// "/aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address}", +// "/aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address}" +// }; +// +// List<String>keys = new LinkedList<String>(); +// keys.addAll(nameValues.keySet()); +// for(String key : keys) { +// if(key.contains(".")) { +// key = key.replaceAll("_", "-"); +// if(!LIST_L3_INTERFACE_IPV4_ADDRESS.equals(key)) { +// int index = key.indexOf("."); +// String resource = key.substring(0, index); +// AAIRequest rx = createRequest(resource, nameValues); +// if(rx != null) { +// pathElements.add(rx); +// } +// } +// } +// } +// super.processRequestPathValues(nameValues); +// } +// List<AAIRequest> pathElements = new LinkedList<AAIRequest>(); + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/L3InterfaceIpv6AddressListRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/L3InterfaceIpv6AddressListRequest.java new file mode 100644 index 00000000..b87f4079 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/L3InterfaceIpv6AddressListRequest.java @@ -0,0 +1,179 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.L3InterfaceIpv6AddressList; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class L3InterfaceIpv6AddressListRequest extends AAIRequest { + + /* + * Note: there are 3 possible paths: + * /aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * /aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * /aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * /aai/v7/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/cloud-infrastructure/cloud-regions/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + * aaiv7:inventory/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + */ + + public static final String L3_INTERFACE_IPV6_ADDRESS_LIST_PATH = "org.openecomp.sdnc.sli.aai.path.l3.interface.ipv6.address.list"; + public static final String VLAN_L3_INTERFACE_IPV6_ADDRESS_LIST_PATH = "org.openecomp.sdnc.sli.aai.path.vlan.l3.interface.ipv6.address.list"; + + private final String l3_interface_ipv6_address_list_path; + private final String vlan_l3_interface_ipv6_address_list_path; + + public static final String L3_INTERFACE_IPV6_ADDRESS = "l3-interface-ipv6-address"; + public static final String LIST_L3_INTERFACE_IPV6_ADDRESS = "l3-interface-ipv6-address-list.l3-interface-ipv6-address"; + public static final String VLAN_INTERFACE = "vlan-interface"; + public static final String VLAN_VLAN_INTERFACE = "vlan.vlan-interface"; + + public L3InterfaceIpv6AddressListRequest() { + l3_interface_ipv6_address_list_path = configProperties.getProperty(L3_INTERFACE_IPV6_ADDRESS_LIST_PATH); + vlan_l3_interface_ipv6_address_list_path = configProperties.getProperty(VLAN_L3_INTERFACE_IPV6_ADDRESS_LIST_PATH); + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+l3_interface_ipv6_address_list_path; + + if(requestProperties.containsKey(VLAN_INTERFACE) || requestProperties.containsKey(VLAN_VLAN_INTERFACE)){ + request_url = target_uri+vlan_l3_interface_ipv6_address_list_path; + request_url = processVLanRequestPathData(request_url, requestProperties); + } + + request_url = processPathData(request_url, requestProperties); + request_url = LInterfaceRequest.processPathData(request_url, requestProperties); +// request_url = GenericVnfRequest.processPathData(request_url, requestProperties); + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + public static String processVLanRequestPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + String key = null; + + if(requestProperties.containsKey(VLAN_VLAN_INTERFACE)) { + key = VLAN_VLAN_INTERFACE; + } else if(requestProperties.containsKey(VLAN_INTERFACE)) { + key = VLAN_INTERFACE; + } else { + aaiService.logKeyError(String.format("%s,%s", VLAN_INTERFACE, VLAN_VLAN_INTERFACE)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + + request_url = request_url.replace("{vlan-interface}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("vlan-interface", requestProperties.getProperty(key)); + return request_url; + } + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + L3InterfaceIpv6AddressList vnfc = (L3InterfaceIpv6AddressList)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vnfc); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = + { + L3_INTERFACE_IPV6_ADDRESS, + LIST_L3_INTERFACE_IPV6_ADDRESS, + VLAN_INTERFACE, + VLAN_VLAN_INTERFACE, + LInterfaceRequest.INTERFACE_NAME, + LInterfaceRequest.LINTERFACE_INTERFACE_NAME, + "generic-vnf.vnf-id" + + }; + + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return L3InterfaceIpv6AddressList.class; + } + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + String key = L3_INTERFACE_IPV6_ADDRESS; + if(requestProperties.containsKey(LIST_L3_INTERFACE_IPV6_ADDRESS)) { + key = LIST_L3_INTERFACE_IPV6_ADDRESS; + } + + if(!requestProperties.containsKey(key)) { + aaiService.logKeyError(String.format("%s,%s", L3_INTERFACE_IPV6_ADDRESS, LIST_L3_INTERFACE_IPV6_ADDRESS)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + + request_url = request_url.replace("{l3-interface-ipv6-address}", encoded_vnf) ; + + aaiService.LOGwriteDateTrace("l3-interface-ipv6-address", requestProperties.getProperty(key)); + return request_url; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/LInterfaceRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/LInterfaceRequest.java new file mode 100644 index 00000000..2553037d --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/LInterfaceRequest.java @@ -0,0 +1,244 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.LInterface; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class LInterfaceRequest extends AAIRequest { + + // tenant (1602) + public static final String LAGINTERFACE_LINTERFACE_PATH = "org.openecomp.sdnc.sli.aai.path.lag.interface.l.interface"; + public static final String LAGINTERFACE_LINTERFACE_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.lag.interface.l.interface.query"; + + public static final String P_INTERFACE_LINTERFACE_PATH = "org.openecomp.sdnc.sli.aai.path.p.interface.l.interface"; + public static final String P_INTERFACE_LINTERFACE_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.p.interface.l.interface.query"; + + public static final String LAGINTERFACE_LINTERFACE_PNF_PATH = "org.openecomp.sdnc.sli.aai.path.lag.interface.l.interface.pnf"; + public static final String P_INTERFACE_LINTERFACE_PNF_PATH = "org.openecomp.sdnc.sli.aai.path.p.interface.l.interface.pnf"; + + private final String laginterface_linterface_path; + private final String laginterface_linterface_query_path; + private final String p_interface_linterface_path; + private final String p_interface_linterface_query_path; + + private final String laginterface_linterface_pnf_path; + private final String p_interface_linterface_pnf_path; + + public static final String INTERFACE_NAME = "interface-name"; + public static final String LINTERFACE_INTERFACE_NAME = "l-interface.interface-name"; + public static final String LAG_INTERFACE_INTERFACE_NAME = "lag-interface.interface-name"; + public static final String P_INTERFACE_INTERFACE_NAME = "p-interface.interface-name"; + public static final String PNF_PNF_NAME = "pnf.pnf-name"; + + public static final String ROUTER_NAME = "router-name"; + public static final String HOSTNAME = "hostname"; + + + public static enum TYPE { L2_BRIDGE_BGF, L2_BRIDGE_SBG}; + + private final TYPE type; + + public LInterfaceRequest(TYPE type) { + this.type = type; + + laginterface_linterface_path = configProperties.getProperty(LAGINTERFACE_LINTERFACE_PATH); + laginterface_linterface_query_path = configProperties.getProperty(LAGINTERFACE_LINTERFACE_QUERY_PATH); + + p_interface_linterface_path = configProperties.getProperty(P_INTERFACE_LINTERFACE_PATH); + p_interface_linterface_query_path = configProperties.getProperty(P_INTERFACE_LINTERFACE_QUERY_PATH); + + laginterface_linterface_pnf_path = configProperties.getProperty(LAGINTERFACE_LINTERFACE_PNF_PATH); + p_interface_linterface_pnf_path = configProperties.getProperty(P_INTERFACE_LINTERFACE_PNF_PATH); + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = null; + String encoded_vnf = null; + String hostname = null; + String pnfname = null; + String interfaceName = null; + + if(type == TYPE.L2_BRIDGE_SBG) { + if(requestProperties.containsKey(PNF_PNF_NAME)) { + request_url = target_uri + laginterface_linterface_pnf_path; + } else { + request_url = target_uri + laginterface_linterface_path; + } + + if(requestProperties.containsKey(ROUTER_NAME)) { + hostname = requestProperties.getProperty(ROUTER_NAME); + encoded_vnf = encodeQuery(hostname); + request_url = request_url.replace("{hostname}", encoded_vnf); + } + + if(requestProperties.containsKey(HOSTNAME)) { + hostname = requestProperties.getProperty(HOSTNAME); + encoded_vnf = encodeQuery(hostname); + request_url = request_url.replace("{hostname}", encoded_vnf); + } + + if(requestProperties.containsKey(PNF_PNF_NAME)) { + pnfname = requestProperties.getProperty(PNF_PNF_NAME); + encoded_vnf = encodeQuery(pnfname); + request_url = request_url.replace("{pnf-name}", encoded_vnf); + } + + encoded_vnf = encodeQuery(requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME)); + request_url = request_url.replace("{lag-interface.interface-name}", encoded_vnf) ; + + + interfaceName = requestProperties.getProperty(INTERFACE_NAME); + if(interfaceName == null || interfaceName.isEmpty()) { + interfaceName = requestProperties.getProperty(LINTERFACE_INTERFACE_NAME); + } + encoded_vnf = encodeQuery(interfaceName); + request_url = request_url.replace("{interface-name}", encoded_vnf) ; + + } + if(type == TYPE.L2_BRIDGE_BGF) { + if(requestProperties.containsKey(PNF_PNF_NAME)) { + request_url = target_uri + p_interface_linterface_pnf_path; + } else { + request_url = target_uri + p_interface_linterface_path; + } + + + if(requestProperties.containsKey(ROUTER_NAME)) { + hostname = requestProperties.getProperty(ROUTER_NAME); + encoded_vnf = encodeQuery(hostname); + request_url = request_url.replace("{hostname}", encoded_vnf); + } + + if(requestProperties.containsKey(HOSTNAME)) { + hostname = requestProperties.getProperty(HOSTNAME); + encoded_vnf = encodeQuery(hostname); + request_url = request_url.replace("{hostname}", encoded_vnf); + } + + if(requestProperties.containsKey(PNF_PNF_NAME)) { + pnfname = requestProperties.getProperty(PNF_PNF_NAME); + encoded_vnf = encodeQuery(pnfname); + request_url = request_url.replace("{pnf-name}", encoded_vnf); + } + + encoded_vnf = encodeQuery(requestProperties.getProperty(P_INTERFACE_INTERFACE_NAME)); + request_url = request_url.replace("{p-interface.interface-name}", encoded_vnf) ; + + + interfaceName = requestProperties.getProperty(INTERFACE_NAME); + if(interfaceName == null || interfaceName.isEmpty()) { + interfaceName = requestProperties.getProperty(LINTERFACE_INTERFACE_NAME); + } + encoded_vnf = encodeQuery(interfaceName); + request_url = request_url.replace("{interface-name}", encoded_vnf) ; + } + + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + if(hostname != null) + aaiService.LOGwriteDateTrace("hostname", hostname); + if(pnfname != null) + aaiService.LOGwriteDateTrace("pnf-name", pnfname); + if(requestProperties.containsKey(LAG_INTERFACE_INTERFACE_NAME)) { + aaiService.LOGwriteDateTrace("lag-interface.interface-name", requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME)); + } + if(requestProperties.containsKey(P_INTERFACE_INTERFACE_NAME)) { + aaiService.LOGwriteDateTrace("p-interface.interface-name", requestProperties.getProperty(P_INTERFACE_INTERFACE_NAME)); + } + aaiService.LOGwriteDateTrace("interface-name", interfaceName); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + LInterface vnfc = (LInterface)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vnfc); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {}; + if(type == TYPE.L2_BRIDGE_SBG) { + String[] tmpArray = {INTERFACE_NAME, LINTERFACE_INTERFACE_NAME, LAG_INTERFACE_INTERFACE_NAME, HOSTNAME, ROUTER_NAME, PNF_PNF_NAME}; + args = tmpArray; + } + if(type == TYPE.L2_BRIDGE_BGF) { + String[] tmpArray = {INTERFACE_NAME, LINTERFACE_INTERFACE_NAME, P_INTERFACE_INTERFACE_NAME, HOSTNAME, ROUTER_NAME, PNF_PNF_NAME}; + args = tmpArray; + } + + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return LInterface.class; + } + + @Override + public String getPrimaryResourceName(String resource) { + return "l-interface"; + } + + public static final String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + String interfaceName = requestProperties.getProperty(INTERFACE_NAME); + if(interfaceName == null || interfaceName.isEmpty()) { + interfaceName = requestProperties.getProperty(LINTERFACE_INTERFACE_NAME); + } + + request_url = request_url.replace("{interface-name}", encodeQuery(interfaceName)) ; + return request_url; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/LagInterfacePnfRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/LagInterfacePnfRequest.java new file mode 100644 index 00000000..2c103623 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/LagInterfacePnfRequest.java @@ -0,0 +1,142 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.LagInterface; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class LagInterfacePnfRequest extends AAIRequest { + + // tenant (1602) + public static final String LAG_INTERFACE_PATH = "org.openecomp.sdnc.sli.aai.path.pserver.pinterface"; + public static final String LAG_INTERFACE_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.pserver.pinterface.query"; + public static final String PNF_PATH = "org.openecomp.sdnc.sli.aai.path.pnf"; + + private final String lag_interface_path; + private final String lag_interface_query_path; + + public static final String INTERFACE_NAME = "interface-name"; + public static final String LAG_INTERFACE_INTERFACE_NAME = "lag-interface.interface-name"; + public static final String PNF_NAME = "pnf-name"; + public static final String PNF_PNF_NAME = "pnf.pnf-name"; + + + public LagInterfacePnfRequest() { + lag_interface_path = configProperties.getProperty(PNF_PATH) + "/lag-interfaces/lag-interface/{interface-name}"; + lag_interface_query_path = configProperties.getProperty(LAG_INTERFACE_QUERY_PATH); + LoggerFactory.getLogger(LagInterfacePnfRequest.class).debug("org.openecomp.sdnc.sli.aai.path.pserver.pinterface=\t" + lag_interface_path); + LoggerFactory.getLogger(LagInterfacePnfRequest.class).debug("org.openecomp.sdnc.sli.aai.path.pserver.pinterface.query=\t" + lag_interface_query_path); + if(lag_interface_path == null) { + LoggerFactory.getLogger(LagInterfacePnfRequest.class).warn("org.openecomp.sdnc.sli.aai.path.pserver.pinterface PATH not found in aaiclient.properties"); + } + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri + lag_interface_path; + String encoded_vnf = null; + + String interfaceName = null; + + if(requestProperties.containsKey(INTERFACE_NAME)) { + interfaceName = requestProperties.getProperty(INTERFACE_NAME); + } else + if(requestProperties.containsKey(LAG_INTERFACE_INTERFACE_NAME)) { + interfaceName = requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME); + } + + encoded_vnf = encodeQuery(interfaceName); + request_url = request_url.replace("{interface-name}", encoded_vnf) ; + + request_url = processPnfRequestPathData(request_url,requestProperties); + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + aaiService.LOGwriteDateTrace("interface-name", interfaceName); + + return http_req_url; + } + + public static String processPnfRequestPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + + String key = PNF_NAME; + if(requestProperties.containsKey(PNF_PNF_NAME)) { + key = PNF_PNF_NAME; + } + + if(!requestProperties.containsKey(key)) { + aaiService.logKeyError(String.format("%s,%s", PNF_NAME, PNF_PNF_NAME)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{pnf-name}", encoded_vnf) ; + + return request_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + LagInterface vnfc = (LagInterface)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vnfc); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = {INTERFACE_NAME, LAG_INTERFACE_INTERFACE_NAME, PNF_PNF_NAME}; + + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return LagInterface.class; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/NamedQueryRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/NamedQueryRequest.java new file mode 100644 index 00000000..4ee51745 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/NamedQueryRequest.java @@ -0,0 +1,190 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.InventoryResponseItems; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.AnnotationIntrospector; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.type.TypeFactory; +import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector; + +public class NamedQueryRequest extends AAIRequest { + + public static final String NAMED_SEARCH_PATH = "org.openecomp.sdnc.sli.aai.query.named"; + + private final String named_search_path; + + public static final String NAMED_QUERY_UUID = "named-query-uuid"; + public static final String PREFIX = "prefix"; + + + public NamedQueryRequest() { + named_search_path = configProperties.getProperty(NAMED_SEARCH_PATH); + } + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+named_search_path; + + request_url = processPathData(request_url, requestProperties); + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = AAIService.getObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + mapper.setSerializationInclusion(Include.NON_EMPTY); + mapper.setSerializationInclusion(Include.NON_DEFAULT); + + AnnotationIntrospector introspector = new JaxbAnnotationIntrospector(TypeFactory.defaultInstance()); + AnnotationIntrospector secondary = new JacksonAnnotationIntrospector(); + mapper.setAnnotationIntrospector(AnnotationIntrospector.pair(introspector, secondary)); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + + AAIDatum tenant = (AAIDatum)requestDatum; + String json_text = null; + try { + ObjectNode node = mapper.valueToTree(tenant); + Iterator<JsonNode> it = node.elements(); + while(it.hasNext()){ + JsonNode jn = it.next(); + JsonNode child = jn.get("instance-filter"); + if(child != null) { + child = child.get(0); + if(child.has("l3-network")) { + JsonNode innerChild = child.get("l3-network"); + if(innerChild != null) { + if(innerChild instanceof ObjectNode) { + ObjectNode on = ObjectNode.class.cast(innerChild); + List<String> namesToDelete = new ArrayList<String>(); + Iterator<String> names = on.fieldNames(); + while(names.hasNext()) { + String name = names.next(); + if(name != null && name.startsWith("is-")) { + namesToDelete.add(name); + } + } + for(String nameToDelete : namesToDelete) { + on.remove(nameToDelete); + } + } + } + } else if(child.has("pnf")) { + JsonNode innerChild = child.get("pnf"); + if(innerChild != null) { + if(innerChild instanceof ObjectNode) { + ObjectNode on = ObjectNode.class.cast(innerChild); + List<String> namesToDelete = new ArrayList<String>(); + Iterator<String> names = on.fieldNames(); + while(names.hasNext()) { + String name = names.next(); + if(name != null && name.startsWith("in-maint")) { + namesToDelete.add(name); + } + } + for(String nameToDelete : namesToDelete) { + on.remove(nameToDelete); + } + } + } + } + } + } + json_text = node.toString(); + if(json_text == null) + json_text = mapper.writeValueAsString(tenant); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {NAMED_QUERY_UUID, PREFIX}; + return args; + } + + + @Override + public Class<? extends AAIDatum> getModelClass() { + return InventoryResponseItems.class; + } + + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + + + String encoded_vnf ; + String key = NAMED_QUERY_UUID; + + if(requestProperties.containsKey(key)) { + encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{named-query-uuid}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("named-query-uuid", requestProperties.getProperty(key)); + } + + key = PREFIX; + + if(requestProperties.containsKey(key)) { + encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{prefix}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("prefix", requestProperties.getProperty(key)); + } + + return request_url; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/NodesQueryRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/NodesQueryRequest.java new file mode 100644 index 00000000..c4141876 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/NodesQueryRequest.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.SearchResults; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class NodesQueryRequest extends AAIRequest { + + public static final String NODES_SEARCH_PATH = "org.openecomp.sdnc.sli.aai.query.nodes"; + + private final String nodes_search_path; + + public static final String NODE_TYPE = "node-type"; + public static final String ENTITY_IDENTIFIER = "entity-identifier"; + public static final String ENTITY_VALUE = "entity-value"; + + + public NodesQueryRequest() { + nodes_search_path = configProperties.getProperty(NODES_SEARCH_PATH); + } + + +// @Override +// public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { +// +// String request_url = target_uri+generic_search_path; +// String key = START_NODE_TYPE; +// +// String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); +// request_url = request_url.replace("{vnf-id}", encoded_vnf) ; +// +// if(resourceVersion != null) { +// request_url = request_url +"?resource-version="+resourceVersion; +// } +// URL http_req_url = new URL(request_url); +// +// aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); +// +// +// return http_req_url; +// } + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+nodes_search_path; + + request_url = processPathData(request_url, requestProperties); + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + SearchResults tenant = (SearchResults)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(tenant); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {NODE_TYPE, ENTITY_IDENTIFIER, ENTITY_VALUE}; + return args; + } + + + @Override + public Class<? extends AAIDatum> getModelClass() { + return SearchResults.class; + } + + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + + String key = ENTITY_IDENTIFIER; + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{entity-identifier}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("entity-identifier", requestProperties.getProperty(key)); + + key = ENTITY_VALUE; + + encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{entity-name}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("entity-name", requestProperties.getProperty(key)); + + key = NODE_TYPE; + + encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{node-type}", encoded_vnf) ; + aaiService.LOGwriteDateTrace("node-type", requestProperties.getProperty(key)); + + return request_url; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PInterfacePnfRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PInterfacePnfRequest.java new file mode 100644 index 00000000..99bce9d1 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PInterfacePnfRequest.java @@ -0,0 +1,142 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.PInterface; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class PInterfacePnfRequest extends AAIRequest { + + // tenant (1602) + public static final String PINTERFACE_PATH = "org.openecomp.sdnc.sli.aai.path.pserver.pinterface"; + public static final String PINTERFACE_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.pserver.pinterface.query"; + public static final String PNF_PATH = "org.openecomp.sdnc.sli.aai.path.pnf"; + + private final String pinterface_path; + private final String pinterface_query_path; + + public static final String INTERFACE_NAME = "interface-name"; + public static final String PINTERFACE_INTERFACE_NAME = "p-interface.interface-name"; + public static final String PNF_NAME = "pnf-name"; + public static final String PNF_PNF_NAME = "pnf.pnf-name"; + + + public PInterfacePnfRequest() { + pinterface_path = configProperties.getProperty(PNF_PATH) + "/p-interfaces/p-interface/{interface-name}"; + pinterface_query_path = configProperties.getProperty(PINTERFACE_QUERY_PATH); + LoggerFactory.getLogger(PInterfacePnfRequest.class).debug("org.openecomp.sdnc.sli.aai.path.pserver.pinterface=\t" + pinterface_path); + LoggerFactory.getLogger(PInterfacePnfRequest.class).debug("org.openecomp.sdnc.sli.aai.path.pserver.pinterface.query=\t" + pinterface_query_path); + if(pinterface_path == null) { + LoggerFactory.getLogger(PInterfacePnfRequest.class).warn("org.openecomp.sdnc.sli.aai.path.pserver.pinterface PATH not found in aaiclient.properties"); + } + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri + pinterface_path; + String encoded_vnf = null; + + String interfaceName = null; + + if(requestProperties.containsKey(INTERFACE_NAME)) { + interfaceName = requestProperties.getProperty(INTERFACE_NAME); + } else + if(requestProperties.containsKey(PINTERFACE_INTERFACE_NAME)) { + interfaceName = requestProperties.getProperty(PINTERFACE_INTERFACE_NAME); + } + + encoded_vnf = encodeQuery(interfaceName); + request_url = request_url.replace("{interface-name}", encoded_vnf) ; + + request_url = processPnfRequestPathData(request_url,requestProperties); + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + aaiService.LOGwriteDateTrace("interface-name", interfaceName); + + return http_req_url; + } + + public static String processPnfRequestPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + + String key = PNF_NAME; + if(requestProperties.containsKey(PNF_PNF_NAME)) { + key = PNF_PNF_NAME; + } + + if(!requestProperties.containsKey(key)) { + aaiService.logKeyError(String.format("%s,%s", PNF_NAME, PNF_PNF_NAME)); + } + + String encoded_vnf = encodeQuery(requestProperties.getProperty(key)); + request_url = request_url.replace("{pnf-name}", encoded_vnf) ; + + return request_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + PInterface vnfc = (PInterface)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vnfc); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = {INTERFACE_NAME, PINTERFACE_INTERFACE_NAME, PNF_NAME, PNF_PNF_NAME}; + + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return PInterface.class; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PInterfaceRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PInterfaceRequest.java new file mode 100644 index 00000000..a08a3929 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PInterfaceRequest.java @@ -0,0 +1,132 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.openecomp.aai.inventory.v10.PInterface; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class PInterfaceRequest extends AAIRequest { + + // tenant (1602) + public static final String PINTERFACE_PATH = "org.openecomp.sdnc.sli.aai.path.pserver.pinterface"; + public static final String PINTERFACE_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.pserver.pinterface.query"; + + private final String pinterface_path; + private final String pinterface_query_path; + + public static final String HOSTNAME = "hostname"; + public static final String PSERVER_HOSTNAME = "pserver.hostname"; + public static final String INTERFACE_NAME = "interface-name"; + public static final String PINTERFACE_INTERFACE_NAME = "p-interface.interface-name"; + + + public PInterfaceRequest() { + pinterface_path = configProperties.getProperty(PINTERFACE_PATH); + pinterface_query_path = configProperties.getProperty(PINTERFACE_QUERY_PATH); + LoggerFactory.getLogger(PInterfaceRequest.class).debug("org.openecomp.sdnc.sli.aai.path.pserver.pinterface=\t" + pinterface_path); + LoggerFactory.getLogger(PInterfaceRequest.class).debug("org.openecomp.sdnc.sli.aai.path.pserver.pinterface.query=\t" + pinterface_query_path); + if(pinterface_path == null) { + LoggerFactory.getLogger(PInterfaceRequest.class).warn("org.openecomp.sdnc.sli.aai.path.pserver.pinterface PATH not found in aaiclient.properties"); + } + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri + pinterface_path; + String encoded_vnf = null; + + String hostname = null; + String interfaceName = null; + + if(requestProperties.containsKey(HOSTNAME)) { + hostname = requestProperties.getProperty(HOSTNAME); + } + if(requestProperties.containsKey(PSERVER_HOSTNAME)) { + hostname = requestProperties.getProperty(PSERVER_HOSTNAME); + } + + if(requestProperties.containsKey(INTERFACE_NAME)) { + interfaceName = requestProperties.getProperty(INTERFACE_NAME); + } + if(requestProperties.containsKey(PINTERFACE_INTERFACE_NAME)) { + interfaceName = requestProperties.getProperty(PINTERFACE_INTERFACE_NAME); + } + + encoded_vnf = encodeQuery(hostname); + request_url = request_url.replace("{hostname}", encoded_vnf) ; + + encoded_vnf = encodeQuery(interfaceName); + request_url = request_url.replace("{interface-name}", encoded_vnf) ; + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + aaiService.LOGwriteDateTrace("hostname", hostname); + aaiService.LOGwriteDateTrace("interface-name", hostname); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + PInterface vnfc = (PInterface)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vnfc); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = {HOSTNAME, PSERVER_HOSTNAME, INTERFACE_NAME, PINTERFACE_INTERFACE_NAME}; + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return PInterface.class; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PathRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PathRequest.java new file mode 100644 index 00000000..0e110a11 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PathRequest.java @@ -0,0 +1,88 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class PathRequest extends AAIRequest { + + private final Class<? extends AAIDatum> classType; + + public static final String RESOURCE_PATH = "resource-path"; + + public PathRequest(Class<?> type) { + classType = (Class<? extends AAIDatum>)type; + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri + "{resource-path}"; + + String encoded_vnf = requestProperties.getProperty(RESOURCE_PATH); + request_url = request_url.replace("{resource-path}", encoded_vnf) ; + + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + String json_text = null; + try { + json_text = mapper.writeValueAsString(classType); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = {RESOURCE_PATH}; + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return classType; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PhysicalLinkRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PhysicalLinkRequest.java new file mode 100644 index 00000000..a03298ae --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/PhysicalLinkRequest.java @@ -0,0 +1,112 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.openecomp.aai.inventory.v10.PhysicalLink; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class PhysicalLinkRequest extends AAIRequest { + + // physical link + public static final String PHYSICAL_LINK_PATH = "org.openecomp.sdnc.sli.aai.path.physical.link"; + public static final String PHYSICAL_LINK_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.physical.link.query"; + + private final String physical_link_path; + private final String physical_link_query_path; + + public static final String LINK_NAME = "link-name"; + public static final String PHYSICAL_LINK_NAME = "physical-link.link-name"; + + + public PhysicalLinkRequest() { + physical_link_path = configProperties.getProperty(PHYSICAL_LINK_PATH); + physical_link_query_path = configProperties.getProperty(PHYSICAL_LINK_QUERY_PATH); + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+physical_link_path; + + String linkName = null; + if(requestProperties.containsKey(LINK_NAME)) { + linkName = requestProperties.getProperty(LINK_NAME); + } + + if(requestProperties.containsKey(PHYSICAL_LINK_NAME)) { + linkName = requestProperties.getProperty(PHYSICAL_LINK_NAME); + } + + + String encoded_vnf = encodeQuery(linkName); + request_url = request_url.replace("{link-name}", encoded_vnf) ; + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + aaiService.LOGwriteDateTrace("link-name", linkName); + + return http_req_url; + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + PhysicalLink vpe = (PhysicalLink)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vpe); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = {LINK_NAME, PHYSICAL_LINK_NAME}; + + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return PhysicalLink.class; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/RelationshipRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/RelationshipRequest.java new file mode 100644 index 00000000..f15cbb59 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/RelationshipRequest.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.openecomp.aai.inventory.v10.RelationshipList; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class RelationshipRequest extends AAIRequest { + + // tenant (1602) + public static final String RELATIONSHIP_LIST_PATH = "org.openecomp.sdnc.sli.aai.path.relationship.list"; + public static final String RELATIONSHIP_LIST_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.relationship.list.query"; + + private final String relationship_path; + private final String relationship_query_path; + + public static final String RELATED_TO = "related-to"; + public static final String RELATIONSHIP_KEY = "relationship-key"; + + public RelationshipRequest() { + relationship_path = configProperties.getProperty(RELATIONSHIP_LIST_PATH, "/relationship-list/relationship"); + relationship_query_path = configProperties.getProperty(RELATIONSHIP_LIST_QUERY_PATH); + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + AAIRequest masterRequest = (AAIRequest)requestProperties.get(MASTER_REQUEST); + URL masterURL = masterRequest.getRequestUrl(method, null); + + String request_url = masterURL.toString(); + request_url = request_url + relationship_path; + + if(request_url.contains("//")) { + request_url = request_url.replaceAll("//", "/"); + } + + if(requestProperties.containsKey(RELATED_TO)) { + String encoded_vnf = encodeQuery(requestProperties.getProperty(RELATED_TO)); + request_url = request_url.replace("{related-to}", encoded_vnf) ; + } + +// if(resourceVersion != null) { +// request_url = request_url +"?resource-version="+resourceVersion; +// } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + aaiService.LOGwriteDateTrace("related-to", requestProperties.getProperty(RELATED_TO)); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = target_uri+relationship_query_path; + String encoded_vnf = encodeQuery(requestProperties.getProperty(RELATIONSHIP_KEY)); + request_url = request_url.replace("{tenant-name}", encoded_vnf) ; + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + aaiService.LOGwriteDateTrace("tenant_name", requestProperties.getProperty(RELATIONSHIP_KEY)); + + return http_req_url; + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + Object tenant = requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(tenant); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {RELATED_TO, RELATIONSHIP_KEY}; + return args; + } + + + @Override + public Class<? extends AAIDatum> getModelClass() { + return RelationshipList.class; + } + + public boolean isDeleteDataRequired() { + return true; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/SelfLinkRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/SelfLinkRequest.java new file mode 100644 index 00000000..7c307652 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/SelfLinkRequest.java @@ -0,0 +1,98 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; + +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Joiner; + +public class SelfLinkRequest extends AAIRequest { + + private final Class<? extends AAIDatum> classType; + + public static final String SELFLINK = "selflink"; + + public SelfLinkRequest(Class<?> type) { + classType = (Class<? extends AAIDatum>)type; + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = null; + + request_url = requestProperties.getProperty(SELFLINK); + + String query = null; + + if(request_url.contains("?")) { + query = request_url.substring(request_url.indexOf("?")); + Joiner.MapJoiner mapJoiner = Joiner.on(",").withKeyValueSeparator("="); +// String queryString = mapJoiner.join(query); + } else { + request_url = request_url + "?depth=1"; + } + + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + String json_text = null; + try { + json_text = mapper.writeValueAsString(classType); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + @Override + public String[] getArgsList() { + String[] args = {SELFLINK}; + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return classType; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/SubInterfaceRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/SubInterfaceRequest.java new file mode 100644 index 00000000..1220ee9a --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/SubInterfaceRequest.java @@ -0,0 +1,184 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Properties; + +import org.openecomp.aai.inventory.v10.LInterface; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class SubInterfaceRequest extends AAIRequest { + + // tenant (1602) + public static final String PNF_LAGINTERFACE_SUBINTERFACE_PATH = "org.openecomp.sdnc.sli.aai.path.pnf.lag.interface.subinterface"; + public static final String PNF_LAGINTERFACE_SUBINTERFACE_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.pnf.lag.interface.subinterface.query"; + + public static final String PNF_P_INTERFACE_SUBINTERFACE_PATH = "org.openecomp.sdnc.sli.aai.path.pnf.p.interface.l.interface"; + public static final String PNF_P_INTERFACE_SUBINTERFACE_QUERY_PATH = "org.openecomp.sdnc.sli.aai.path.pnf.p.interface.l.interface.query"; + + private final String pnf_laginterface_subinterface_path; + private final String pnf_laginterface_subinterface_query_path; + private final String pnf_p_interface_subinterface_path; + private final String pnf_p_interface_subinterface_query_path; + + public static final String SUBINTERFACE_INTERFACE_NAME = "l-interface.interface-name"; + public static final String LAG_INTERFACE_INTERFACE_NAME = "lag-interface.interface-name"; + public static final String PNF_PNF_NAME = "pnf.pnf-name"; + public static enum TYPE { L2_BRIDGE_BGF, L2_BRIDGE_SBG}; + + private final TYPE type; + + public SubInterfaceRequest(TYPE type) { + this.type = type; + + pnf_laginterface_subinterface_path = configProperties.getProperty(PNF_LAGINTERFACE_SUBINTERFACE_PATH); + pnf_laginterface_subinterface_query_path = configProperties.getProperty(PNF_LAGINTERFACE_SUBINTERFACE_QUERY_PATH); + + pnf_p_interface_subinterface_path = configProperties.getProperty(PNF_P_INTERFACE_SUBINTERFACE_PATH); + pnf_p_interface_subinterface_query_path = configProperties.getProperty(PNF_P_INTERFACE_SUBINTERFACE_QUERY_PATH); + } + + + @Override + public URL getRequestUrl(String method, String resourceVersion) throws UnsupportedEncodingException, MalformedURLException { + + String request_url = null; + String encoded_vnf = null; + + String pnfname = null; + String interfaceName = null; + + if(type == TYPE.L2_BRIDGE_SBG) { + request_url = target_uri + pnf_laginterface_subinterface_path; + + if(requestProperties.containsKey(PNF_PNF_NAME)) { + pnfname = requestProperties.getProperty(PNF_PNF_NAME); + encoded_vnf = encodeQuery(pnfname); + request_url = request_url.replace("{pnf-name}", encoded_vnf); + } + + encoded_vnf = encodeQuery(requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME)); + request_url = request_url.replace("{lag-interface.interface-name}", encoded_vnf) ; + + + interfaceName = requestProperties.getProperty(SUBINTERFACE_INTERFACE_NAME); + encoded_vnf = encodeQuery(interfaceName); + request_url = request_url.replace("{interface-name}", encoded_vnf) ; + + } + if(type == TYPE.L2_BRIDGE_BGF) { + request_url = target_uri + pnf_p_interface_subinterface_path; + + if(requestProperties.containsKey(PNF_PNF_NAME)) { + pnfname = requestProperties.getProperty(PNF_PNF_NAME); + encoded_vnf = encodeQuery(pnfname); + request_url = request_url.replace("{pnf-name}", encoded_vnf); + } + + encoded_vnf = encodeQuery(requestProperties.getProperty(PInterfaceRequest.PINTERFACE_INTERFACE_NAME)); + request_url = request_url.replace("{p-interface.interface-name}", encoded_vnf) ; + + + interfaceName = requestProperties.getProperty(SUBINTERFACE_INTERFACE_NAME); + encoded_vnf = encodeQuery(interfaceName); + request_url = request_url.replace("{interface-name}", encoded_vnf) ; + } + + + if(resourceVersion != null) { + request_url = request_url +"?resource-version="+resourceVersion; + } + URL http_req_url = new URL(request_url); + + aaiService.LOGwriteFirstTrace(method, http_req_url.toString()); + + if(pnfname != null) + aaiService.LOGwriteDateTrace("pnf-name", pnfname); + if(requestProperties.containsKey(LAG_INTERFACE_INTERFACE_NAME)) { + aaiService.LOGwriteDateTrace("lag-interface.interface-name", requestProperties.getProperty(LAG_INTERFACE_INTERFACE_NAME)); + } + if(requestProperties.containsKey(PInterfaceRequest.PINTERFACE_INTERFACE_NAME)) { + aaiService.LOGwriteDateTrace("p-interface.interface-name", requestProperties.getProperty(PInterfaceRequest.PINTERFACE_INTERFACE_NAME)); + } + aaiService.LOGwriteDateTrace("interface-name", interfaceName); + + return http_req_url; + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return this.getRequestUrl(method, null); + } + + + @Override + public String toJSONString() { + ObjectMapper mapper = getObjectMapper(); + LInterface vnfc = (LInterface)requestDatum; + String json_text = null; + try { + json_text = mapper.writeValueAsString(vnfc); + } catch (JsonProcessingException exc) { + handleException(this, exc); + return null; + } + return json_text; + } + + + @Override + public String[] getArgsList() { + String[] args = {}; + if(type == TYPE.L2_BRIDGE_SBG) { + String[] tmpArray = {SUBINTERFACE_INTERFACE_NAME, LAG_INTERFACE_INTERFACE_NAME, PNF_PNF_NAME}; + args = tmpArray; + } + if(type == TYPE.L2_BRIDGE_BGF) { + String[] tmpArray = {SUBINTERFACE_INTERFACE_NAME, PInterfaceRequest.PINTERFACE_INTERFACE_NAME, PNF_PNF_NAME}; + args = tmpArray; + } + + return args; + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return LInterface.class; + } + + @Override + public String getPrimaryResourceName(String resource) { + return "sub-interface"; + } + + public static final String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + String interfaceName = requestProperties.getProperty(SUBINTERFACE_INTERFACE_NAME); + request_url = request_url.replace("{interface-name}", encodeQuery(interfaceName)) ; + return request_url; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/UpdateRequest.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/UpdateRequest.java new file mode 100644 index 00000000..696f30bd --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/UpdateRequest.java @@ -0,0 +1,106 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai; + +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Map; +import java.util.Properties; + +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class UpdateRequest extends AAIRequest { + + private AAIRequest request; + private Map<String, String> params; + + public UpdateRequest(AAIRequest request, Map<String, String> parms) { + this.request = request; + this.params = parms; + } + + @Override + public URL getRequestUrl(String method, String resourceVersion) + throws UnsupportedEncodingException, MalformedURLException { + return request.getRequestUrl(method, resourceVersion); + } + + @Override + public URL getRequestQueryUrl(String method) throws UnsupportedEncodingException, MalformedURLException { + return request.getRequestQueryUrl(method); + } + + @Override + public String toJSONString() { + ObjectMapper mapper = AAIService.getObjectMapper(); + String json = null; + + try { + json = mapper.writeValueAsString(params); + } catch (JsonProcessingException e) { + LOG.error("Could not convert parameters of " + request.getRequestObject().getClass().getName(), e); + } + + return json; + } + + @Override + public String[] getArgsList() { + return request.getArgsList(); + } + + @Override + public Class<? extends AAIDatum> getModelClass() { + return request.getModelClass(); + } + + @Override + public void addRequestProperty(String key, String value) { + request.requestProperties.put(key, value); + } + + public static String processPathData(String request_url, Properties requestProperties) throws UnsupportedEncodingException { + +// if(request != null) { +// Class<?> clazz = request.getClass(); +// Method function = null; +// try { +// function = clazz.getMethod("processPathData", request_url.getClass(), requestProperties.getClass()); +// request_url = (String) function.invoke(null, request_url, requestProperties); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } + +// request.processPathData(request_url, requestProperties); + return request_url; + } + + public void processRequestPathValues(Map<String, String> nameValues) { + request.processRequestPathValues(nameValues); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/AAIDatum.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/AAIDatum.java new file mode 100644 index 00000000..fe238026 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/AAIDatum.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +public interface AAIDatum { + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/EchoResponse.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/EchoResponse.java new file mode 100644 index 00000000..1b9cb8d4 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/EchoResponse.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "responseMessages" +}) +public class EchoResponse implements AAIDatum { + + @JsonProperty("responseMessages") + private ResponseMessages responseMessages; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The responseMessages + */ + @JsonProperty("responseMessages") + public ResponseMessages getResponseMessages() { + return responseMessages; + } + + /** + * + * @param responseMessages + * The responseMessages + */ + @JsonProperty("responseMessages") + public void setResponseMessages(ResponseMessages responseMessages) { + this.responseMessages = responseMessages; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ErrorResponse.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ErrorResponse.java new file mode 100644 index 00000000..be5368d1 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ErrorResponse.java @@ -0,0 +1,78 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "requestError" +}) +public class ErrorResponse { + + @JsonProperty("requestError") + private RequestError requestError; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The requestError + */ + @JsonProperty("requestError") + public RequestError getRequestError() { + return requestError; + } + + /** + * + * @param requestError + * The requestError + */ + @JsonProperty("requestError") + public void setRequestError(RequestError requestError) { + this.requestError = requestError; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/RequestError.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/RequestError.java new file mode 100644 index 00000000..df875f8c --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/RequestError.java @@ -0,0 +1,78 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "serviceException" +}) +public class RequestError { + + @JsonProperty("serviceException") + private ServiceException serviceException; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The serviceException + */ + @JsonProperty("serviceException") + public ServiceException getServiceException() { + return serviceException; + } + + /** + * + * @param serviceException + * The serviceException + */ + @JsonProperty("serviceException") + public void setServiceException(ServiceException serviceException) { + this.serviceException = serviceException; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResourceVersion.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResourceVersion.java new file mode 100644 index 00000000..5ac06e6b --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResourceVersion.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +public interface ResourceVersion { + + public String getResourceVersion(); + public void setResourceVersion(String resourceVersion); +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResponseMessage.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResponseMessage.java new file mode 100644 index 00000000..c1f9582a --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResponseMessage.java @@ -0,0 +1,122 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "messageId", + "text", + "variables" +}) +public class ResponseMessage { + + @JsonProperty("messageId") + private String messageId; + @JsonProperty("text") + private String text; + @JsonProperty("variables") + private Variables variables; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The messageId + */ + @JsonProperty("messageId") + public String getMessageId() { + return messageId; + } + + /** + * + * @param messageId + * The messageId + */ + @JsonProperty("messageId") + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + /** + * + * @return + * The text + */ + @JsonProperty("text") + public String getText() { + return text; + } + + /** + * + * @param text + * The text + */ + @JsonProperty("text") + public void setText(String text) { + this.text = text; + } + + /** + * + * @return + * The variables + */ + @JsonProperty("variables") + public Variables getVariables() { + return variables; + } + + /** + * + * @param variables + * The variables + */ + @JsonProperty("variables") + public void setVariables(Variables variables) { + this.variables = variables; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResponseMessages.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResponseMessages.java new file mode 100644 index 00000000..5af83aae --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ResponseMessages.java @@ -0,0 +1,78 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "responseMessage" +}) +public class ResponseMessages { + + @JsonProperty("responseMessage") + private List<ResponseMessage> responseMessage = new ArrayList<ResponseMessage>(); + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The responseMessage + */ + @JsonProperty("responseMessage") + public List<ResponseMessage> getResponseMessage() { + return responseMessage; + } + + /** + * + * @param responseMessage + * The responseMessage + */ + @JsonProperty("responseMessage") + public void setResponseMessage(List<ResponseMessage> responseMessage) { + this.responseMessage = responseMessage; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ServiceException.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ServiceException.java new file mode 100644 index 00000000..b02b448e --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/ServiceException.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "messageId", + "text", + "variables" +}) +public class ServiceException { + + @JsonProperty("messageId") + private String messageId; + @JsonProperty("text") + private String text; + @JsonProperty("variables") + private List<String> variables = new ArrayList<String>(); + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The messageId + */ + @JsonProperty("messageId") + public String getMessageId() { + return messageId; + } + + /** + * + * @param messageId + * The messageId + */ + @JsonProperty("messageId") + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + /** + * + * @return + * The text + */ + @JsonProperty("text") + public String getText() { + return text; + } + + /** + * + * @param text + * The text + */ + @JsonProperty("text") + public void setText(String text) { + this.text = text; + } + + /** + * + * @return + * The variables + */ + @JsonProperty("variables") + public List<String> getVariables() { + return variables; + } + + /** + * + * @param variables + * The variables + */ + @JsonProperty("variables") + public void setVariables(List<String> variables) { + this.variables = variables; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/SubInterface.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/SubInterface.java new file mode 100644 index 00000000..a85e0219 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/SubInterface.java @@ -0,0 +1,171 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import org.openecomp.aai.inventory.v10.RelationshipList; +import org.openecomp.aai.inventory.v10.Vlans; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "interface-name", + "interface-role", + "resource-version", + "vlans", + "relationshipList" +}) +public class SubInterface implements AAIDatum { + + @JsonProperty("interface-name") + private String interfaceName; + @JsonProperty("interface-role") + private String interfaceRole; + @JsonProperty("resource-version") + private String resourceVersion; + @JsonProperty("vlans") + private Vlans vlans; + @JsonProperty("relationshipList") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The interfaceName + */ + @JsonProperty("interface-name") + public String getInterfaceName() { + return interfaceName; + } + + /** + * + * @param interfaceName + * The interface-name + */ + @JsonProperty("interface-name") + public void setInterfaceName(String interfaceName) { + this.interfaceName = interfaceName; + } + + /** + * + * @return + * The interfaceRole + */ + @JsonProperty("interface-role") + public String getInterfaceRole() { + return interfaceRole; + } + + /** + * + * @param interfaceRole + * The interface-role + */ + @JsonProperty("interface-role") + public void setInterfaceRole(String interfaceRole) { + this.interfaceRole = interfaceRole; + } + + /** + * + * @return + * The resourceVersion + */ + @JsonProperty("resource-version") + public String getResourceVersion() { + return resourceVersion; + } + + /** + * + * @param resourceVersion + * The resource-version + */ + @JsonProperty("resource-version") + public void setResourceVersion(String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + /** + * + * @return + * The vlans + */ + @JsonProperty("vlans") + public Vlans getVlans() { + return vlans; + } + + /** + * + * @param vlans + * The vlans + */ + @JsonProperty("vlans") + public void setVlans(Vlans vlans) { + this.vlans = vlans; + } + + /** + * + * @return + * The relationshipList + */ + @JsonProperty("relationshipList") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + /** + * + * @param relationshipList + * The relationshipList + */ + @JsonProperty("relationshipList") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/Variables.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/Variables.java new file mode 100644 index 00000000..99c42aa3 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/Variables.java @@ -0,0 +1,78 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "variable" +}) +public class Variables { + + @JsonProperty("variable") + private List<String> variable = new ArrayList<String>(); + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The variable + */ + @JsonProperty("variable") + public List<String> getVariable() { + return variable; + } + + /** + * + * @param variable + * The variable + */ + @JsonProperty("variable") + public void setVariable(List<String> variable) { + this.variable = variable; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/notify/KeyDatum.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/notify/KeyDatum.java new file mode 100644 index 00000000..80e633dd --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/notify/KeyDatum.java @@ -0,0 +1,99 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.notify; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "key-name", + "key-value" +}) +public class KeyDatum { + + @JsonProperty("key-name") + private String keyName; + @JsonProperty("key-value") + private String keyValue; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The keyName + */ + @JsonProperty("key-name") + public String getKeyName() { + return keyName; + } + + /** + * + * @param keyName + * The key-name + */ + @JsonProperty("key-name") + public void setKeyName(String keyName) { + this.keyName = keyName; + } + + /** + * + * @return + * The keyValue + */ + @JsonProperty("key-value") + public String getKeyValue() { + return keyValue; + } + + /** + * + * @param keyValue + * The key-value + */ + @JsonProperty("key-value") + public void setKeyValue(String keyValue) { + this.keyValue = keyValue; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/notify/NotifyEvent.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/notify/NotifyEvent.java new file mode 100644 index 00000000..1be171e0 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/notify/NotifyEvent.java @@ -0,0 +1,170 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.notify; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "event-id", + "event-trigger", + "key-data", + "node-type", + "selflink" +}) +public class NotifyEvent { + + @JsonProperty("event-id") + private String eventId; + @JsonProperty("event-trigger") + private String eventTrigger; + @JsonProperty("key-data") + private List<KeyDatum> keyData = new ArrayList<KeyDatum>(); + @JsonProperty("node-type") + private String nodeType; + @JsonProperty("selflink") + private String selflink; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The eventId + */ + @JsonProperty("event-id") + public String getEventId() { + return eventId; + } + + /** + * + * @param eventId + * The event-id + */ + @JsonProperty("event-id") + public void setEventId(String eventId) { + this.eventId = eventId; + } + + /** + * + * @return + * The eventTrigger + */ + @JsonProperty("event-trigger") + public String getEventTrigger() { + return eventTrigger; + } + + /** + * + * @param eventTrigger + * The event-trigger + */ + @JsonProperty("event-trigger") + public void setEventTrigger(String eventTrigger) { + this.eventTrigger = eventTrigger; + } + + /** + * + * @return + * The keyData + */ + @JsonProperty("key-data") + public List<KeyDatum> getKeyData() { + return keyData; + } + + /** + * + * @param keyData + * The key-data + */ + @JsonProperty("key-data") + public void setKeyData(List<KeyDatum> keyData) { + this.keyData = keyData; + } + + /** + * + * @return + * The nodeType + */ + @JsonProperty("node-type") + public String getNodeType() { + return nodeType; + } + + /** + * + * @param nodeType + * The node-type + */ + @JsonProperty("node-type") + public void setNodeType(String nodeType) { + this.nodeType = nodeType; + } + + /** + * + * @return + * The selflink + */ + @JsonProperty("selflink") + public String getSelflink() { + return selflink; + } + + /** + * + * @param selflink + * The selflink + */ + @JsonProperty("selflink") + public void setSelflink(String selflink) { + this.selflink = selflink; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Flavor.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Flavor.java new file mode 100644 index 00000000..69288c11 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Flavor.java @@ -0,0 +1,122 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.v1507; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "flavorId", + "flavorName", + "flavorLink" +}) +public class Flavor { + + @JsonProperty("flavorId") + private String flavorId; + @JsonProperty("flavorName") + private String flavorName; + @JsonProperty("flavorLink") + private String flavorLink; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The flavorId + */ + @JsonProperty("flavorId") + public String getFlavorId() { + return flavorId; + } + + /** + * + * @param flavorId + * The flavorId + */ + @JsonProperty("flavorId") + public void setFlavorId(String flavorId) { + this.flavorId = flavorId; + } + + /** + * + * @return + * The flavorName + */ + @JsonProperty("flavorName") + public String getFlavorName() { + return flavorName; + } + + /** + * + * @param flavorName + * The flavorName + */ + @JsonProperty("flavorName") + public void setFlavorName(String flavorName) { + this.flavorName = flavorName; + } + + /** + * + * @return + * The flavorLink + */ + @JsonProperty("flavorLink") + public String getFlavorLink() { + return flavorLink; + } + + /** + * + * @param flavorLink + * The flavorLink + */ + @JsonProperty("flavorLink") + public void setFlavorLink(String flavorLink) { + this.flavorLink = flavorLink; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Host.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Host.java new file mode 100644 index 00000000..e4a5720a --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Host.java @@ -0,0 +1,122 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.v1507; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "hostId", + "hostname", + "hostLoc" +}) +public class Host { + + @JsonProperty("hostId") + private String hostId; + @JsonProperty("hostname") + private String hostname; + @JsonProperty("hostLoc") + private String hostLoc; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The hostId + */ + @JsonProperty("hostId") + public String getHostId() { + return hostId; + } + + /** + * + * @param hostId + * The hostId + */ + @JsonProperty("hostId") + public void setHostId(String hostId) { + this.hostId = hostId; + } + + /** + * + * @return + * The hostname + */ + @JsonProperty("hostname") + public String getHostname() { + return hostname; + } + + /** + * + * @param hostname + * The hostname + */ + @JsonProperty("hostname") + public void setHostname(String hostname) { + this.hostname = hostname; + } + + /** + * + * @return + * The hostLoc + */ + @JsonProperty("hostLoc") + public String getHostLoc() { + return hostLoc; + } + + /** + * + * @param hostLoc + * The hostLoc + */ + @JsonProperty("hostLoc") + public void setHostLoc(String hostLoc) { + this.hostLoc = hostLoc; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Image.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Image.java new file mode 100644 index 00000000..19ae8749 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Image.java @@ -0,0 +1,237 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.v1507; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "imageId", + "imageName", + "osType", + "osVersion", + "application", + "applicationVersion", + "applicationVendor", + "imageLink" +}) +public class Image { + + @JsonProperty("imageId") + private String imageId; + @JsonProperty("imageName") + private String imageName; + @JsonProperty("osType") + private String osType; + @JsonProperty("osVersion") + private String osVersion; + @JsonProperty("application") + private String application; + @JsonProperty("applicationVersion") + private String applicationVersion; + @JsonProperty("applicationVendor") + private String applicationVendor; + @JsonProperty("imageLink") + private String imageLink; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The imageId + */ + @JsonProperty("imageId") + public String getImageId() { + return imageId; + } + + /** + * + * @param imageId + * The imageId + */ + @JsonProperty("imageId") + public void setImageId(String imageId) { + this.imageId = imageId; + } + + /** + * + * @return + * The imageName + */ + @JsonProperty("imageName") + public String getImageName() { + return imageName; + } + + /** + * + * @param imageName + * The imageName + */ + @JsonProperty("imageName") + public void setImageName(String imageName) { + this.imageName = imageName; + } + + /** + * + * @return + * The osType + */ + @JsonProperty("osType") + public String getOsType() { + return osType; + } + + /** + * + * @param osType + * The osType + */ + @JsonProperty("osType") + public void setOsType(String osType) { + this.osType = osType; + } + + /** + * + * @return + * The osVersion + */ + @JsonProperty("osVersion") + public String getOsVersion() { + return osVersion; + } + + /** + * + * @param osVersion + * The osVersion + */ + @JsonProperty("osVersion") + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + /** + * + * @return + * The application + */ + @JsonProperty("application") + public String getApplication() { + return application; + } + + /** + * + * @param application + * The application + */ + @JsonProperty("application") + public void setApplication(String application) { + this.application = application; + } + + /** + * + * @return + * The applicationVersion + */ + @JsonProperty("applicationVersion") + public String getApplicationVersion() { + return applicationVersion; + } + + /** + * + * @param applicationVersion + * The applicationVersion + */ + @JsonProperty("applicationVersion") + public void setApplicationVersion(String applicationVersion) { + this.applicationVersion = applicationVersion; + } + + /** + * + * @return + * The applicationVendor + */ + @JsonProperty("applicationVendor") + public String getApplicationVendor() { + return applicationVendor; + } + + /** + * + * @param applicationVendor + * The applicationVendor + */ + @JsonProperty("applicationVendor") + public void setApplicationVendor(String applicationVendor) { + this.applicationVendor = applicationVendor; + } + + /** + * + * @return + * The imageLink + */ + @JsonProperty("imageLink") + public String getImageLink() { + return imageLink; + } + + /** + * + * @param imageLink + * The imageLink + */ + @JsonProperty("imageLink") + public void setImageLink(String imageLink) { + this.imageLink = imageLink; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/IpAddress.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/IpAddress.java new file mode 100644 index 00000000..1d29857a --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/IpAddress.java @@ -0,0 +1,168 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.v1507; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "addrId", + "addr", + "version", + "type", + "networkName" +}) +public class IpAddress { + + @JsonProperty("addrId") + private String addrId; + @JsonProperty("addr") + private String addr; + @JsonProperty("version") + private String version; + @JsonProperty("type") + private String type; + @JsonProperty("networkName") + private String networkName; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The addrId + */ + @JsonProperty("addrId") + public String getAddrId() { + return addrId; + } + + /** + * + * @param addrId + * The addrId + */ + @JsonProperty("addrId") + public void setAddrId(String addrId) { + this.addrId = addrId; + } + + /** + * + * @return + * The addr + */ + @JsonProperty("addr") + public String getAddr() { + return addr; + } + + /** + * + * @param addr + * The addr + */ + @JsonProperty("addr") + public void setAddr(String addr) { + this.addr = addr; + } + + /** + * + * @return + * The version + */ + @JsonProperty("version") + public String getVersion() { + return version; + } + + /** + * + * @param version + * The version + */ + @JsonProperty("version") + public void setVersion(String version) { + this.version = version; + } + + /** + * + * @return + * The type + */ + @JsonProperty("type") + public String getType() { + return type; + } + + /** + * + * @param type + * The type + */ + @JsonProperty("type") + public void setType(String type) { + this.type = type; + } + + /** + * + * @return + * The networkName + */ + @JsonProperty("networkName") + public String getNetworkName() { + return networkName; + } + + /** + * + * @param networkName + * The networkName + */ + @JsonProperty("networkName") + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Relationship.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Relationship.java new file mode 100644 index 00000000..623bd722 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/Relationship.java @@ -0,0 +1,147 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.v1507; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "relatedTo", + "relatedLink", + "relationshipData", + "any" +}) +public class Relationship { + + @JsonProperty("relatedTo") + private String relatedTo; + @JsonProperty("relatedLink") + private String relatedLink; + @JsonProperty("relationshipData") + private List<RelationshipDatum> relationshipData = new ArrayList<RelationshipDatum>(); + @JsonProperty("any") + private List<Object> any = new ArrayList<Object>(); + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The relatedTo + */ + @JsonProperty("relatedTo") + public String getRelatedTo() { + return relatedTo; + } + + /** + * + * @param relatedTo + * The relatedTo + */ + @JsonProperty("relatedTo") + public void setRelatedTo(String relatedTo) { + this.relatedTo = relatedTo; + } + + /** + * + * @return + * The relatedLink + */ + @JsonProperty("relatedLink") + public String getRelatedLink() { + return relatedLink; + } + + /** + * + * @param relatedLink + * The relatedLink + */ + @JsonProperty("relatedLink") + public void setRelatedLink(String relatedLink) { + this.relatedLink = relatedLink; + } + + /** + * + * @return + * The relationshipData + */ + @JsonProperty("relationshipData") + public List<RelationshipDatum> getRelationshipData() { + return relationshipData; + } + + /** + * + * @param relationshipData + * The relationshipData + */ + @JsonProperty("relationshipData") + public void setRelationshipData(List<RelationshipDatum> relationshipData) { + this.relationshipData = relationshipData; + } + + /** + * + * @return + * The any + */ + @JsonProperty("any") + public List<Object> getAny() { + return any; + } + + /** + * + * @param any + * The any + */ + @JsonProperty("any") + public void setAny(List<Object> any) { + this.any = any; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/RelationshipDatum.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/RelationshipDatum.java new file mode 100644 index 00000000..9f44c1fa --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/RelationshipDatum.java @@ -0,0 +1,124 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.v1507; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "relationshipKey", + "relationshipValue", + "any" +}) +public class RelationshipDatum { + + @JsonProperty("relationshipKey") + private String relationshipKey; + @JsonProperty("relationshipValue") + private String relationshipValue; + @JsonProperty("any") + private List<Object> any = new ArrayList<Object>(); + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The relationshipKey + */ + @JsonProperty("relationshipKey") + public String getRelationshipKey() { + return relationshipKey; + } + + /** + * + * @param relationshipKey + * The relationshipKey + */ + @JsonProperty("relationshipKey") + public void setRelationshipKey(String relationshipKey) { + this.relationshipKey = relationshipKey; + } + + /** + * + * @return + * The relationshipValue + */ + @JsonProperty("relationshipValue") + public String getRelationshipValue() { + return relationshipValue; + } + + /** + * + * @param relationshipValue + * The relationshipValue + */ + @JsonProperty("relationshipValue") + public void setRelationshipValue(String relationshipValue) { + this.relationshipValue = relationshipValue; + } + + /** + * + * @return + * The any + */ + @JsonProperty("any") + public List<Object> getAny() { + return any; + } + + /** + * + * @param any + * The any + */ + @JsonProperty("any") + public void setAny(List<Object> any) { + this.any = any; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/RelationshipList.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/RelationshipList.java new file mode 100644 index 00000000..242b0911 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/RelationshipList.java @@ -0,0 +1,101 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.v1507; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "relationship", + "any" +}) +public class RelationshipList { + + @JsonProperty("relationship") + private List<Relationship> relationship = new ArrayList<Relationship>(); + @JsonProperty("any") + private List<Object> any = new ArrayList<Object>(); + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The relationship + */ + @JsonProperty("relationship") + public List<Relationship> getRelationship() { + return relationship; + } + + /** + * + * @param relationship + * The relationship + */ + @JsonProperty("relationship") + public void setRelationship(List<Relationship> relationship) { + this.relationship = relationship; + } + + /** + * + * @return + * The any + */ + @JsonProperty("any") + public List<Object> getAny() { + return any; + } + + /** + * + * @param any + * The any + */ + @JsonProperty("any") + public void setAny(List<Object> any) { + this.any = any; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/VServer.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/VServer.java new file mode 100644 index 00000000..6c975604 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/data/v1507/VServer.java @@ -0,0 +1,262 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.data.v1507; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "vmId", + "vmName", + "vmName2", + "host", + "image", + "flavor", + "ipAddresses", + "vserverLink", + "relationshipList" +}) +public class VServer { + + @JsonProperty("vmId") + private String vmId; + @JsonProperty("vmName") + private String vmName; + @JsonProperty("vmName2") + private String vmName2; + @JsonProperty("host") + private Host host; + @JsonProperty("image") + private Image image; + @JsonProperty("flavor") + private Flavor flavor; + @JsonProperty("ipAddresses") + private List<IpAddress> ipAddresses = new ArrayList<IpAddress>(); + @JsonProperty("vserverLink") + private String vserverLink; + @JsonProperty("relationshipList") + private RelationshipList relationshipList; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The vmId + */ + @JsonProperty("vmId") + public String getVmId() { + return vmId; + } + + /** + * + * @param vmId + * The vmId + */ + @JsonProperty("vmId") + public void setVmId(String vmId) { + this.vmId = vmId; + } + + /** + * + * @return + * The vmName + */ + @JsonProperty("vmName") + public String getVmName() { + return vmName; + } + + /** + * + * @param vmName + * The vmName + */ + @JsonProperty("vmName") + public void setVmName(String vmName) { + this.vmName = vmName; + } + + /** + * + * @return + * The vmName2 + */ + @JsonProperty("vmName2") + public String getVmName2() { + return vmName2; + } + + /** + * + * @param vmName2 + * The vmName2 + */ + @JsonProperty("vmName2") + public void setVmName2(String vmName2) { + this.vmName2 = vmName2; + } + + /** + * + * @return + * The host + */ + @JsonProperty("host") + public Host getHost() { + return host; + } + + /** + * + * @param host + * The host + */ + @JsonProperty("host") + public void setHost(Host host) { + this.host = host; + } + + /** + * + * @return + * The image + */ + @JsonProperty("image") + public Image getImage() { + return image; + } + + /** + * + * @param image + * The image + */ + @JsonProperty("image") + public void setImage(Image image) { + this.image = image; + } + + /** + * + * @return + * The flavor + */ + @JsonProperty("flavor") + public Flavor getFlavor() { + return flavor; + } + + /** + * + * @param flavor + * The flavor + */ + @JsonProperty("flavor") + public void setFlavor(Flavor flavor) { + this.flavor = flavor; + } + + /** + * + * @return + * The ipAddresses + */ + @JsonProperty("ipAddresses") + public List<IpAddress> getIpAddresses() { + return ipAddresses; + } + + /** + * + * @param ipAddresses + * The ipAddresses + */ + @JsonProperty("ipAddresses") + public void setIpAddresses(List<IpAddress> ipAddresses) { + this.ipAddresses = ipAddresses; + } + + /** + * + * @return + * The vserverLink + */ + @JsonProperty("vserverLink") + public String getVserverLink() { + return vserverLink; + } + + /** + * + * @param vserverLink + * The vserverLink + */ + @JsonProperty("vserverLink") + public void setVserverLink(String vserverLink) { + this.vserverLink = vserverLink; + } + + /** + * + * @return + * The relationshipList + */ + @JsonProperty("relationshipList") + public RelationshipList getRelationshipList() { + return relationshipList; + } + + /** + * + * @param relationshipList + * The relationshipList + */ + @JsonProperty("relationshipList") + public void setRelationshipList(RelationshipList relationshipList) { + this.relationshipList = relationshipList; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/FormattedQueryRequestData.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/FormattedQueryRequestData.java new file mode 100644 index 00000000..78d890aa --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/FormattedQueryRequestData.java @@ -0,0 +1,83 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.query; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +import com.fasterxml.jackson.annotation.JsonProperty; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "start", + "query" +}) +@XmlRootElement(name = "query-request") +public class FormattedQueryRequestData implements AAIDatum { + + @JsonProperty("start") + protected List<String> start; + + @JsonProperty("query") + private String query; + + @JsonProperty("start") + public List<String> getStart () + { + return start; + } + + @JsonProperty("start") + public void setStart (List<String> start) + { + this.start = start; + } + + @JsonProperty("query") + public String getQuery () + { + return query; + } + + @JsonProperty("query") + public void setQuery (String query) + { + this.query = query; + } + + @Override + public String toString() + { + return " [start = "+start+", query = "+query+"]"; + } + + public String getResourceVersion() { + return null; + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/FormattedQueryResultList.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/FormattedQueryResultList.java new file mode 100644 index 00000000..48b2a60b --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/FormattedQueryResultList.java @@ -0,0 +1,59 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.query; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import org.openecomp.sdnc.sli.aai.data.AAIDatum; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "results" +}) +@XmlRootElement(name = "result-list") +public class FormattedQueryResultList implements AAIDatum { + + @XmlElement(name = "results") + private List<Results> results; + @XmlElement(name = "results") + public List<Results> getResults () + { + return results; + } + @XmlElement(name = "results") + public void setResults (List<Results> results) + { + this.results = results; + } + + @Override + public String toString() + { + return "ClassPojo [results = "+results+"]"; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/InstanceFilter.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/InstanceFilter.java new file mode 100644 index 00000000..33f1fec2 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/InstanceFilter.java @@ -0,0 +1,133 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.query; + +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import org.openecomp.aai.inventory.v10.L3Network; +import org.openecomp.aai.inventory.v10.Pnf; +import org.openecomp.aai.inventory.v10.LogicalLink; +import org.openecomp.aai.inventory.v10.ServiceInstance; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "logical-link", + "pnf", + "l3-network", + "service-instance" +}) +public class InstanceFilter { + + @JsonProperty("logical-link") + private LogicalLink logicalLink; + @JsonProperty("pnf") + private Pnf pnf; + @JsonProperty("l3-network") + private L3Network l3Network; + @JsonProperty("service-instance") + private ServiceInstance serviceInstance; + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The logicalLink + */ + @JsonProperty("logical-link") + public LogicalLink getLogicalLink() { + return logicalLink; + } + + /** + * + * @param logicalLink + * The logical-link + */ + @JsonProperty("logical-link") + public void setLogicalLink(LogicalLink logicalLink) { + this.logicalLink = logicalLink; + } + + /** + * + * @return + * The pnf + */ + @JsonProperty("pnf") + public Pnf getPnf() { + return pnf; + } + + /** + * + * @param pnf + * The pnf + */ + @JsonProperty("pnf") + public void setPnf(Pnf pnf) { + this.pnf = pnf; + } + + @JsonProperty("l3-network") + public L3Network getL3Network() { + return l3Network; + } + + @JsonProperty("l3-network") + public void setL3Network(L3Network l3Network) { + this.l3Network = l3Network; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + @JsonProperty("service-instance") + public ServiceInstance getServiceInstance() { + return serviceInstance; + } + + @JsonProperty("service-instance") + public void setServiceInstance(ServiceInstance serviceInstance) { + this.serviceInstance = serviceInstance; + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/InstanceFilters.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/InstanceFilters.java new file mode 100644 index 00000000..d38beed0 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/InstanceFilters.java @@ -0,0 +1,78 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.query; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "instance-filter" +}) +public class InstanceFilters { + + @JsonProperty("instance-filter") + private List<InstanceFilter> instanceFilter = new ArrayList<InstanceFilter>(); + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The instanceFilter + */ + @JsonProperty("instance-filter") + public List<InstanceFilter> getInstanceFilter() { + return instanceFilter; + } + + /** + * + * @param instanceFilter + * The instance-filter + */ + @JsonProperty("instance-filter") + public void setInstanceFilter(List<InstanceFilter> instanceFilter) { + this.instanceFilter = instanceFilter; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/NamedQuery.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/NamedQuery.java new file mode 100644 index 00000000..5b20903d --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/NamedQuery.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.query; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "named-query-uuid" +}) +public class NamedQuery { + + @JsonProperty("named-query-uuid") + private String namedQueryUuid; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The namedQueryUuid + */ + @JsonProperty("named-query-uuid") + public String getNamedQueryUuid() { + return namedQueryUuid; + } + + /** + * + * @param namedQueryUuid + * The named-query-uuid + */ + @JsonProperty("named-query-uuid") + public void setNamedQueryUuid(String namedQueryUuid) { + this.namedQueryUuid = namedQueryUuid; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/NamedQueryData.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/NamedQueryData.java new file mode 100644 index 00000000..e8a77529 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/NamedQueryData.java @@ -0,0 +1,101 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.query; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; + +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "query-parameters", + "instance-filters" +}) +public class NamedQueryData implements AAIDatum { + + @JsonProperty("query-parameters") + private QueryParameters queryParameters; + @JsonProperty("instance-filters") + private InstanceFilters instanceFilters; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The queryParameters + */ + @JsonProperty("query-parameters") + public QueryParameters getQueryParameters() { + return queryParameters; + } + + /** + * + * @param queryParameters + * The query-parameters + */ + @JsonProperty("query-parameters") + public void setQueryParameters(QueryParameters queryParameters) { + this.queryParameters = queryParameters; + } + + /** + * + * @return + * The instanceFilters + */ + @JsonProperty("instance-filters") + public InstanceFilters getInstanceFilters() { + return instanceFilters; + } + + /** + * + * @param instanceFilters + * The instance-filters + */ + @JsonProperty("instance-filters") + public void setInstanceFilters(InstanceFilters instanceFilters) { + this.instanceFilters = instanceFilters; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/QueryParameters.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/QueryParameters.java new file mode 100644 index 00000000..bb4498cf --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/QueryParameters.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.query; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "named-query" +}) +public class QueryParameters { + + @JsonProperty("named-query") + private NamedQuery namedQuery; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The namedQuery + */ + @JsonProperty("named-query") + public NamedQuery getNamedQuery() { + return namedQuery; + } + + /** + * + * @param namedQuery + * The named-query + */ + @JsonProperty("named-query") + public void setNamedQuery(NamedQuery namedQuery) { + this.namedQuery = namedQuery; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/Results.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/Results.java new file mode 100644 index 00000000..2931a7e1 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/query/Results.java @@ -0,0 +1,84 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.query; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +import org.openecomp.aai.inventory.v10.*; + + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "genericVnf", + "pserver", + "complex" +}) +@XmlRootElement(name = "results") +public class Results { + + @XmlElement(name = "generic-vnf") + private GenericVnf genericVnf; + + @XmlElement(name = "complex") + private Complex complex; + + @XmlElement(name = "pserver") + private Pserver pserver; + + + @XmlElement(name = "generic-vnf") + public GenericVnf getGenericVnf () + { + return genericVnf; + } + @XmlElement(name = "generic-vnf") + public void setGenericVnf (GenericVnf genericVnf) + { + this.genericVnf = genericVnf; + } + + @Override + public String toString() + { + return " [generic-vnf = "+genericVnf+"]"; + } + @XmlElement(name = "complex") + public Complex getComplex() { + return complex; + } + @XmlElement(name = "complex") + public void setComplex(Complex complex) { + this.complex = complex; + } + @XmlElement(name = "pserver") + public Pserver getPserver() { + return pserver; + } + @XmlElement(name = "pserver") + public void setPserver(Pserver pserver) { + this.pserver = pserver; + } +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/Action.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/Action.java new file mode 100644 index 00000000..296a3713 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/Action.java @@ -0,0 +1,101 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.update; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "action-data", + "action-type" +}) +public class Action { + + @JsonProperty("action-data") + private List<ActionDatum> actionData = new ArrayList<ActionDatum>(); + @JsonProperty("action-type") + private String actionType; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The actionData + */ + @JsonProperty("action-data") + public List<ActionDatum> getActionData() { + return actionData; + } + + /** + * + * @param actionData + * The action-data + */ + @JsonProperty("action-data") + public void setActionData(List<ActionDatum> actionData) { + this.actionData = actionData; + } + + /** + * + * @return + * The actionType + */ + @JsonProperty("action-type") + public String getActionType() { + return actionType; + } + + /** + * + * @param actionType + * The action-type + */ + @JsonProperty("action-type") + public void setActionType(String actionType) { + this.actionType = actionType; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/ActionDatum.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/ActionDatum.java new file mode 100644 index 00000000..3dfb9c37 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/ActionDatum.java @@ -0,0 +1,99 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.update; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "property-name", + "property-value" +}) +public class ActionDatum { + + @JsonProperty("property-name") + private String propertyName; + @JsonProperty("property-value") + private String propertyValue; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The propertyName + */ + @JsonProperty("property-name") + public String getPropertyName() { + return propertyName; + } + + /** + * + * @param propertyName + * The property-name + */ + @JsonProperty("property-name") + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + /** + * + * @return + * The propertyValue + */ + @JsonProperty("property-value") + public String getPropertyValue() { + return propertyValue; + } + + /** + * + * @param propertyValue + * The property-value + */ + @JsonProperty("property-value") + public void setPropertyValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/Update.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/Update.java new file mode 100644 index 00000000..a092b6b9 --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/Update.java @@ -0,0 +1,124 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.update; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "update-node-type", + "update-node-key", + "action" +}) +public class Update { + + @JsonProperty("update-node-type") + private String updateNodeType; + @JsonProperty("action") + private List<Action> action = new ArrayList<Action>(); + @JsonProperty("update-node-key") + private List<UpdateNodeKey> updateNodeKey = new ArrayList<UpdateNodeKey>(); + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The updateNodeType + */ + @JsonProperty("update-node-type") + public String getUpdateNodeType() { + return updateNodeType; + } + + /** + * + * @param updateNodeType + * The update-node-type + */ + @JsonProperty("update-node-type") + public void setUpdateNodeType(String updateNodeType) { + this.updateNodeType = updateNodeType; + } + + /** + * + * @return + * The action + */ + @JsonProperty("action") + public List<Action> getAction() { + return action; + } + + /** + * + * @param action + * The action + */ + @JsonProperty("action") + public void setAction(List<Action> action) { + this.action = action; + } + + /** + * + * @return + * The updateNodeKey + */ + @JsonProperty("update-node-key") + public List<UpdateNodeKey> getUpdateNodeKey() { + return updateNodeKey; + } + + /** + * + * @param updateNodeKey + * The update-node-key + */ + @JsonProperty("update-node-key") + public void setUpdateNodeKey(List<UpdateNodeKey> updateNodeKey) { + this.updateNodeKey = updateNodeKey; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/UpdateNodeKey.java b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/UpdateNodeKey.java new file mode 100644 index 00000000..ffc5cc0d --- /dev/null +++ b/aai-service/provider/src/main/java/org/openecomp/sdnc/sli/aai/update/UpdateNodeKey.java @@ -0,0 +1,99 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.update; + +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@Generated("org.jsonschema2pojo") +@JsonPropertyOrder({ + "key-name", + "key-value" +}) +public class UpdateNodeKey { + + @JsonProperty("key-name") + private String keyName; + @JsonProperty("key-value") + private String keyValue; + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<String, Object>(); + + /** + * + * @return + * The keyName + */ + @JsonProperty("key-name") + public String getKeyName() { + return keyName; + } + + /** + * + * @param keyName + * The key-name + */ + @JsonProperty("key-name") + public void setKeyName(String keyName) { + this.keyName = keyName; + } + + /** + * + * @return + * The keyValue + */ + @JsonProperty("key-value") + public String getKeyValue() { + return keyValue; + } + + /** + * + * @param keyValue + * The key-value + */ + @JsonProperty("key-value") + public void setKeyValue(String keyValue) { + this.keyValue = keyValue; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + +} diff --git a/aai-service/provider/src/main/resources/aai-path.properties b/aai-service/provider/src/main/resources/aai-path.properties new file mode 100644 index 00000000..bb42ea07 --- /dev/null +++ b/aai-service/provider/src/main/resources/aai-path.properties @@ -0,0 +1,189 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 ONAP 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========================================================= +### + +complex|ctag-pool = /aai/v10/cloud-infrastructure/complexes/complex/{physical-location-id}/ctag-pools/ctag-pool/{target-pe}/{availability-zone-name} +complex = /aai/v10/cloud-infrastructure/complexes/complex/{physical-location-id} +cloud-region|volume-group = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/volume-groups/volume-group/{volume-group-id} +cloud-region|tenant|vserver|volume = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/volumes/volume/{volume-id} +cloud-region|tenant|vserver|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +cloud-region|tenant|vserver|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +cloud-region|tenant|vserver|l-interface|vlan = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +cloud-region|tenant|vserver|l-interface|sriov-vf = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +cloud-region|tenant|vserver|l-interface|l3-interface-ipv4-address-list = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +cloud-region|tenant|vserver|l-interface|l3-interface-ipv6-address-list = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +cloud-region|tenant|vserver|l-interface = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id}/l-interfaces/l-interface/{interface-name} +cloud-region|tenant|vserver = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id} +cloud-region|tenant = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id} +cloud-region|flavor = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/flavors/flavor/{flavor-id} +cloud-region|group-assignment = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/group-assignments/group-assignment/{group-id} +cloud-region|snapshot = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/snapshots/snapshot/{snapshot-id} +cloud-region|image|metadatum = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/images/image/{image-id}/metadata/metadatum/{metaname} +cloud-region|image = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/images/image/{image-id} +cloud-region|dvs-switch = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/dvs-switches/dvs-switch/{switch-name} +cloud-region|oam-network = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/oam-networks/oam-network/{network-uuid} +cloud-region|availability-zone = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/availability-zones/availability-zone/{availability-zone-name} +cloud-region = /aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id} +network-profile = /aai/v10/cloud-infrastructure/network-profiles/network-profile/{nm-profile-name} +pserver|p-interface|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +pserver|p-interface|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +pserver|p-interface|l-interface|vlan = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +pserver|p-interface|l-interface|sriov-vf = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +pserver|p-interface|l-interface|l3-interface-ipv4-address-list = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +pserver|p-interface|l-interface|l3-interface-ipv6-address-list = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +pserver|p-interface|l-interface = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name} +pserver|p-interface = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name} +pserver|lag-interface|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +pserver|lag-interface|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +pserver|lag-interface|l-interface|vlan = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +pserver|lag-interface|l-interface|sriov-vf = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +pserver|lag-interface|l-interface|l3-interface-ipv4-address-list = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +pserver|lag-interface|l-interface|l3-interface-ipv6-address-list = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +pserver|lag-interface|l-interface = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name} +pserver|lag-interface = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{interface-name} +pserver = /aai/v10/cloud-infrastructure/pservers/pserver/{hostname} +virtual-data-center = /aai/v10/cloud-infrastructure/virtual-data-centers/virtual-data-center/{vdc-id} +connector|metadatum = /aai/v10/business/connectors/connector/{resource-instance-id}/metadata/metadatum/{metaname} +connector = /aai/v10/business/connectors/connector/{resource-instance-id} +customer|service-subscription|service-instance|metadatum = /aai/v10/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/metadata/metadatum/{metaname} +customer|service-subscription|service-instance|allotted-resource|tunnel-xconnect = /aai/v10/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/allotted-resources/allotted-resource/{id}/tunnel-xconnects/tunnel-xconnect/{id} +customer|service-subscription|service-instance|allotted-resource = /aai/v10/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/allotted-resources/allotted-resource/{id} +customer|service-subscription|service-instance = /aai/v10/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id} +customer|service-subscription = /aai/v10/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type} +customer = /aai/v10/business/customers/customer/{global-customer-id} +vnf-image = /aai/v10/service-design-and-creation/vnf-images/vnf-image/{att-uuid} +service = /aai/v10/service-design-and-creation/services/service/{service-id} +service-capability = /aai/v10/service-design-and-creation/service-capabilities/service-capability/{service-type}/{vnf-type} +model|model-ver|model-element|model-constraint|constrained-element-set|element-choice-set = /aai/v10/service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}/model-elements/model-element/{model-element-uuid}/model-constraints/model-constraint/{model-constraint-uuid}/constrained-element-sets/constrained-element-set/{constrained-element-set-uuid}/element-choice-sets/element-choice-set/{element-choice-set-uuid} +model|model-ver|model-element|model-constraint|constrained-element-set = /aai/v10/service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}/model-elements/model-element/{model-element-uuid}/model-constraints/model-constraint/{model-constraint-uuid}/constrained-element-sets/constrained-element-set/{constrained-element-set-uuid} +model|model-ver|model-element|model-constraint = /aai/v10/service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}/model-elements/model-element/{model-element-uuid}/model-constraints/model-constraint/{model-constraint-uuid} +model|model-ver|model-element = /aai/v10/service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}/model-elements/model-element/{model-element-uuid} +model|model-ver|metadatum = /aai/v10/service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}/metadata/metadatum/{metaname} +model|model-ver = /aai/v10/service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id} +model = /aai/v10/service-design-and-creation/models/model/{model-invariant-id} +named-query|named-query-element|related-lookup = /aai/v10/service-design-and-creation/named-queries/named-query/{named-query-uuid}/named-query-elements/named-query-element/{named-query-element-uuid}/related-lookups/related-lookup/{related-lookup-uuid} +named-query|named-query-element|property-constraint = /aai/v10/service-design-and-creation/named-queries/named-query/{named-query-uuid}/named-query-elements/named-query-element/{named-query-element-uuid}/property-constraints/property-constraint/{property-constraint-uuid} +named-query|named-query-element = /aai/v10/service-design-and-creation/named-queries/named-query/{named-query-uuid}/named-query-elements/named-query-element/{named-query-element-uuid} +named-query = /aai/v10/service-design-and-creation/named-queries/named-query/{named-query-uuid} +logical-link = /aai/v10/network/logical-links/logical-link/{link-name} +site-pair-set|routing-instance|site-pair|class-of-service = /aai/v10/network/site-pair-sets/site-pair-set/{site-pair-set-id}/routing-instances/routing-instance/{routing-instance-id}/site-pairs/site-pair/{site-pair-id}/classes-of-service/class-of-service/{cos} +site-pair-set|routing-instance|site-pair = /aai/v10/network/site-pair-sets/site-pair-set/{site-pair-set-id}/routing-instances/routing-instance/{routing-instance-id}/site-pairs/site-pair/{site-pair-id} +site-pair-set|routing-instance = /aai/v10/network/site-pair-sets/site-pair-set/{site-pair-set-id}/routing-instances/routing-instance/{routing-instance-id} +site-pair-set = /aai/v10/network/site-pair-sets/site-pair-set/{site-pair-set-id} +vpn-binding|route-target = /aai/v10/network/vpn-bindings/vpn-binding/{vpn-id}/route-targets/route-target/{global-route-target}/{route-target-role} +vpn-binding = /aai/v10/network/vpn-bindings/vpn-binding/{vpn-id} +vpls-pe|p-interface|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +vpls-pe|p-interface|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +vpls-pe|p-interface|l-interface|vlan = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +vpls-pe|p-interface|l-interface|sriov-vf = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +vpls-pe|p-interface|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +vpls-pe|p-interface|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +vpls-pe|p-interface|l-interface = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name} +vpls-pe|p-interface = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/p-interfaces/p-interface/{interface-name} +vpls-pe|lag-interface|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +vpls-pe|lag-interface|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +vpls-pe|lag-interface|l-interface|vlan = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +vpls-pe|lag-interface|l-interface|sriov-vf = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +vpls-pe|lag-interface|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +vpls-pe|lag-interface|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +vpls-pe|lag-interface|l-interface = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name} +vpls-pe|lag-interface = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name}/lag-interfaces/lag-interface/{interface-name} +vpls-pe = /aai/v10/network/vpls-pes/vpls-pe/{equipment-name} +multicast-configuration = /aai/v10/network/multicast-configurations/multicast-configuration/{multicast-configuration-id} +vce|port-group|cvlan-tag-entry = /aai/v10/network/vces/vce/{vnf-id}/port-groups/port-group/{interface-id}/cvlan-tags/cvlan-tag-entry/{cvlan-tag} +vce|port-group = /aai/v10/network/vces/vce/{vnf-id}/port-groups/port-group/{interface-id} +vce|license = /aai/v10/network/vces/vce/{vnf-id}/licenses/license/{group-uuid}/{resource-uuid} +vce|entitlement = /aai/v10/network/vces/vce/{vnf-id}/entitlements/entitlement/{group-uuid}/{resource-uuid} +vce = /aai/v10/network/vces/vce/{vnf-id} +vpe|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +vpe|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +vpe|l-interface|vlan = /aai/v10/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +vpe|l-interface|sriov-vf = /aai/v10/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +vpe|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +vpe|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +vpe|l-interface = /aai/v10/network/vpes/vpe/{vnf-id}/l-interfaces/l-interface/{interface-name} +vpe|lag-interface|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +vpe|lag-interface|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +vpe|lag-interface|l-interface|vlan = /aai/v10/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +vpe|lag-interface|l-interface|sriov-vf = /aai/v10/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +vpe|lag-interface|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +vpe|lag-interface|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +vpe|lag-interface|l-interface = /aai/v10/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name} +vpe|lag-interface = /aai/v10/network/vpes/vpe/{vnf-id}/lag-interfaces/lag-interface/{interface-name} +vpe|license = /aai/v10/network/vpes/vpe/{vnf-id}/licenses/license/{group-uuid}/{resource-uuid} +vpe|entitlement = /aai/v10/network/vpes/vpe/{vnf-id}/entitlements/entitlement/{group-uuid}/{resource-uuid} +vpe = /aai/v10/network/vpes/vpe/{vnf-id} +vnfc = /aai/v10/network/vnfcs/vnfc/{vnfc-name} +l3-network|subnet = /aai/v10/network/l3-networks/l3-network/{network-id}/subnets/subnet/{subnet-id} +l3-network|ctag-assignment = /aai/v10/network/l3-networks/l3-network/{network-id}/ctag-assignments/ctag-assignment/{vlan-id-inner} +l3-network|segmentation-assignment = /aai/v10/network/l3-networks/l3-network/{network-id}/segmentation-assignments/segmentation-assignment/{segmentation-id} +l3-network = /aai/v10/network/l3-networks/l3-network/{network-id} +network-policy = /aai/v10/network/network-policies/network-policy/{network-policy-id} +generic-vnf|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +generic-vnf|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +generic-vnf|l-interface|vlan = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +generic-vnf|l-interface|sriov-vf = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +generic-vnf|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +generic-vnf|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +generic-vnf|l-interface = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name} +generic-vnf|lag-interface|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +generic-vnf|lag-interface|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +generic-vnf|lag-interface|l-interface|vlan = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +generic-vnf|lag-interface|l-interface|sriov-vf = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +generic-vnf|lag-interface|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +generic-vnf|lag-interface|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +generic-vnf|lag-interface|l-interface = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name} +generic-vnf|lag-interface = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/lag-interfaces/lag-interface/{interface-name} +generic-vnf|vf-module = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/vf-modules/vf-module/{vf-module-id} +generic-vnf|license = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/licenses/license/{group-uuid}/{resource-uuid} +generic-vnf|entitlement = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/entitlements/entitlement/{group-uuid}/{resource-uuid} +generic-vnf = /aai/v10/network/generic-vnfs/generic-vnf/{vnf-id} +lag-link = /aai/v10/network/lag-links/lag-link/{link-name} +newvce|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +newvce|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +newvce|l-interface|vlan = /aai/v10/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +newvce|l-interface|sriov-vf = /aai/v10/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +newvce|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +newvce|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +newvce|l-interface = /aai/v10/network/newvces/newvce/{vnf-id2}/l-interfaces/l-interface/{interface-name} +newvce = /aai/v10/network/newvces/newvce/{vnf-id2} +pnf|p-interface|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +pnf|p-interface|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +pnf|p-interface|l-interface|vlan = /aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +pnf|p-interface|l-interface|sriov-vf = /aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +pnf|p-interface|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +pnf|p-interface|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +pnf|p-interface|l-interface = /aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}/l-interfaces/l-interface/{interface-name} +pnf|p-interface = /aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name} +pnf|lag-interface|l-interface|vlan|l3-interface-ipv4-address-list = /aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +pnf|lag-interface|l-interface|vlan|l3-interface-ipv6-address-list = /aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +pnf|lag-interface|l-interface|vlan = /aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface} +pnf|lag-interface|l-interface|sriov-vf = /aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/sriov-vfs/sriov-vf/{pci-id} +pnf|lag-interface|l-interface|l3-interface-ipv4-address-list = /aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +pnf|lag-interface|l-interface|l3-interface-ipv6-address-list = /aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +pnf|lag-interface|l-interface = /aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{interface-name}/l-interfaces/l-interface/{interface-name} +pnf|lag-interface = /aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{interface-name} +pnf = /aai/v10/network/pnfs/pnf/{pnf-name} +physical-link = /aai/v10/network/physical-links/physical-link/{link-name} +ipsec-configuration|vig-server = /aai/v10/network/ipsec-configurations/ipsec-configuration/{ipsec-configuration-id}/vig-servers/vig-server/{vig-address-type} +ipsec-configuration = /aai/v10/network/ipsec-configurations/ipsec-configuration/{ipsec-configuration-id} +route-table-reference = /aai/v10/network/route-table-references/route-table-reference/{route-table-reference-id} +instance-group = /aai/v10/network/instance-groups/instance-group/{id} +zone = /aai/v10/network/zones/zone/{zone-id} diff --git a/aai-service/provider/src/main/resources/aai-schema-bindings.xjb b/aai-service/provider/src/main/resources/aai-schema-bindings.xjb new file mode 100755 index 00000000..e6292fa1 --- /dev/null +++ b/aai-service/provider/src/main/resources/aai-schema-bindings.xjb @@ -0,0 +1,11 @@ +<jxb:bindings version="1.0"
+ xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
+ jxb:extensionBindingPrefixes="xjc">
+ <jxb:bindings schemaLocation="aai_schema_v10.xsd" node="/xs:schema">
+ <jxb:globalBindings>
+ <xjc:superInterface name="org.openecomp.sdnc.sli.aai.data.AAIDatum"/>
+ </jxb:globalBindings>
+ </jxb:bindings>
+</jxb:bindings>
diff --git a/aai-service/provider/src/main/resources/aai_schema_v10.xsd b/aai-service/provider/src/main/resources/aai_schema_v10.xsd new file mode 100755 index 00000000..fed5baf8 --- /dev/null +++ b/aai-service/provider/src/main/resources/aai_schema_v10.xsd @@ -0,0 +1,6563 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<xs:schema elementFormDefault="qualified" version="1.0" targetNamespace="http://org.openecomp.aai.inventory/v10" xmlns:tns="http://org.openecomp.aai.inventory/v10" xmlns:xs="http://www.w3.org/2001/XMLSchema" +xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" + jaxb:version="2.1" + xmlns:annox="http://annox.dev.java.net" + jaxb:extensionBindingPrefixes="annox"> + + <xs:element name="inventory-item-data"> + <xs:complexType> + <xs:sequence> + <xs:element name="property-name" type="xs:string" minOccurs="0"/> + <xs:element name="property-value" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="inventory-item"> + <xs:complexType> + <xs:sequence> + <xs:element name="inventory-item-type" type="xs:string" minOccurs="0"/> + <xs:element name="inventory-item-link" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:inventory-item-data" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="tns:tagged-inventory-item-list" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="tagged-inventory-item-list"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:inventory-item" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="edge-tag-query-result"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:tagged-inventory-item-list" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="start-node-filter"> + <xs:complexType> + <xs:sequence> + <xs:element name="property-name" type="xs:string" minOccurs="0"/> + <xs:element name="property-value" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="include-node-filter"> + <xs:complexType> + <xs:sequence> + <xs:element name="include-node-type" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="secondary-filter"> + <xs:complexType> + <xs:sequence> + <xs:element name="property-name" type="xs:string" minOccurs="0"/> + <xs:element name="filter-type" type="xs:string" minOccurs="0"/> + <xs:element name="property-value" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="edge-tag-query-request"> + <xs:complexType> + <xs:sequence> + <xs:element name="edge-tag" type="xs:string" minOccurs="0"/> + <xs:element name="result-detail" type="xs:string" minOccurs="0"/> + <xs:element name="start-node-type" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:start-node-filter" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="tns:include-node-filter" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="tns:secondary-filter" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="result-data"> + <xs:complexType> + <xs:sequence> + <xs:element name="resource-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The specific type of node in the A&AI graph")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-link" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The URL to the specific resource")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="search-results"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:result-data" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="relationship-data"> + <xs:complexType> + <xs:sequence> + <xs:element name="relationship-key" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="A keyword provided by A&AI to indicate an attribute.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="relationship-value" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Value of the attribute.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="related-to-property"> + <xs:complexType> + <xs:sequence> + <xs:element name="property-key" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Key part of a key/value pair")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="property-value" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Value part of a key/value pair")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="relationship"> + <xs:complexType> + <xs:sequence> + <xs:element name="related-to" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="A keyword provided by A&AI to indicate type of node.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="related-link" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to the object in A&AI.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-data" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="tns:related-to-property" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="relationship-list"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:relationship" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="oam-network"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="OAM network, to be deprecated shortly. Do not use for new purposes. ",nameProps="network-name",indexedProps="cvlan-tag,network-uuid,network-name",dependentOn="cloud-region",container="oam-networks")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="network-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="UUID of the network. Unique across a cloud-region")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of the network.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="cvlan-tag" type="xs:unsignedInt"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="cvlan-id")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-gateway-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for VNF firewall rule so customer cannot send customer traffic over this oam network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-gateway-address-prefix-length" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for VNF firewall rule so customer cannot send customer traffic over this oam network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="oam-networks"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of OAM networks, to be deprecated shortly. Do not use for new purposes. ")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:oam-network" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="dvs-switch"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="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. ",indexedProps="vcenter-url,switch-name",dependentOn="cloud-region",container="dvs-switches")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="switch-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="DVS switch name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vcenter-url" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL used to reach the vcenter")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="dvs-switches"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of digital virtual switch metadata used for vmWare VCEs and VPEs.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:dvs-switch" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="availability-zone"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Availability zone, a collection of compute hosts/pservers",indexedProps="availability-zone-name",dependentOn="cloud-region",container="availability-zones")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="availability-zone-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Name of the availability zone. Unique across a cloud region")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="hypervisor-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Type of hypervisor. Source of truth should define valid values.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="operational-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="az-and-dvs-switches"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:dvs-switches" minOccurs="0"/> + <xs:element ref="tns:availability-zone" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="sdn-zone-response"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:oam-networks" minOccurs="0"/> + <xs:element ref="tns:az-and-dvs-switches" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="search"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:edge-tag-query-result" minOccurs="0"/> + <xs:element ref="tns:edge-tag-query-request" minOccurs="0"/> + <xs:element ref="tns:search-results" minOccurs="0"/> + <xs:element ref="tns:sdn-zone-response" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="update-node-key"> + <xs:complexType> + <xs:sequence> + <xs:element name="key-name" type="xs:string" minOccurs="0"/> + <xs:element name="key-value" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="action-data"> + <xs:complexType> + <xs:sequence> + <xs:element name="property-name" type="xs:string" minOccurs="0"/> + <xs:element name="property-value" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="action"> + <xs:complexType> + <xs:sequence> + <xs:element name="action-type" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:action-data" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="update"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Serves a PATCH like function. Does not enforce concurrency control. Clear each usage with AAI team.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="update-node-type" type="xs:string"/> + <xs:element ref="tns:update-node-key" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="update-node-uri" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:action" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="key-data"> + <xs:complexType> + <xs:sequence> + <xs:element name="key-name" type="xs:string" minOccurs="0"/> + <xs:element name="key-value" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="notify"> + <xs:complexType> + <xs:sequence> + <xs:element name="event-id" type="xs:string"/> + <xs:element name="node-type" type="xs:string" minOccurs="0"/> + <xs:element name="event-trigger" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:key-data" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="selflink" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="actions"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="APIs that are more action related than REST (e.g., notify, update).")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:update" minOccurs="0"/> + <xs:element ref="tns:notify" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="ctag-pool"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="A collection of C tags (vlan tags) grouped for a specific purpose.",indexedProps="availability-zone-name",dependentOn="complex",container="ctag-pools")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="target-pe" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="The Target provider edge router")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="availability-zone-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Name of the availability zone")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ctag-pool-purpose" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Describes what the intended purpose of this pool is.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ctag-values" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Comma separated list of ctags")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="ctag-pools"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:ctag-pool" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="complex"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of physical locations that can house cloud-regions.",indexedProps="identity-url,data-center-code,complex-name,physical-location-id",searchable="physical-location-id,data-center-code,complex-name,street1,street2,postal-code",uniqueProps="physical-location-id",container="complexes",namespace="cloud-infrastructure")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="physical-location-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier for physical location, e.g., CLLI")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="data-center-code" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Data center code which can be an alternate way to identify a complex")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="complex-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Gamma complex name for LCP instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="identity-url" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL of the keystone identity service")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="physical-location-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Type, e.g., central office, data center.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="street1" type="xs:string"/> + <xs:element name="street2" type="xs:string" minOccurs="0"/> + <xs:element name="city" type="xs:string"/> + <xs:element name="state" type="xs:string" minOccurs="0"/> + <xs:element name="postal-code" type="xs:string"/> + <xs:element name="country" type="xs:string"/> + <xs:element name="region" type="xs:string"/> + <xs:element name="latitude" type="xs:string" minOccurs="0"/> + <xs:element name="longitude" type="xs:string" minOccurs="0"/> + <xs:element name="elevation" type="xs:string" minOccurs="0"/> + <xs:element name="lata" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:ctag-pools" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="complexes"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of physical locations that can house cloud-regions.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:complex" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="volume-group"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Persistent block-level storage.",indexedProps="volume-group-name,vnf-type,heat-stack-id,volume-group-id",searchable="volume-group-id,volume-group-name",dependentOn="cloud-region",container="volume-groups")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="volume-group-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of volume-group.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="volume-group-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of the volume group.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this volume-group")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this volume-group")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-customization-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-module-model-customization-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="helps relate the volume group to the vf-module whose components will require the volume group")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="volume-groups"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of persistent block-level storage.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:volume-group" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="volume"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Ephemeral Block storage volume.",indexedProps="volume-id",dependentOn="vserver",container="volumes")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="volume-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of block storage volume relative to the vserver.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="volume-selflink" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="volumes"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of ephemeral Block storage volumes.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:volume" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="l3-interface-ipv4-address-list"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="IPv4 Address Range",indexedProps="l3-interface-ipv4-address,vlan-id-inner,neutron-network-id,neutron-subnet-id",dependentOn="vlan,l-interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="l3-interface-ipv4-address" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="IP address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="l3-interface-ipv4-prefix-length" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Prefix length, 32 for single address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-id-inner" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Inner VLAN tag")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-id-outer" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Outer VLAN tag")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-floating" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Indicator of fixed or floating address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-network-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron network id of the interface that address belongs to")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-subnet-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron id of subnet that address belongs to")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="l3-interface-ipv6-address-list"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="IPv6 Address Range",indexedProps="l3-interface-ipv6-address,vlan-id-inner,neutron-network-id,neutron-subnet-id",dependentOn="vlan,l-interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="l3-interface-ipv6-address" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="IP address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="l3-interface-ipv6-prefix-length" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Prefix length, 128 for single address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-id-inner" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Inner VLAN tag")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-id-outer" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Outer VLAN tag")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-floating" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Indicator of fixed or floating address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-network-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron network id of the interface that address belongs to")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-subnet-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron id of subnet that address belongs to")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vlan"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Definition of vlan",indexedProps="vlan-interface,vlan-id-inner,vpn-id",uniqueProps="vpn-id",dependentOn="l-interface",container="vlans")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vlan-interface" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="String that identifies the interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-id-inner" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Inner VLAN tag")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-id-outer" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Outer VLAN tag")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-value" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-units" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-description" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used to describe (the service associated with) the vlan")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="backdoor-connection" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Whether customer is going to use this VLAN for backdoor connection to another customer premise device.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vpn-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This indicates the customers VPN ID associated with this vlan")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status of a vnf's vlan interface, on which the customer circuit resides, mastered by SDN-C.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:l3-interface-ipv4-address-list" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="tns:l3-interface-ipv6-address-list" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vlans"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:vlan" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="sriov-vf"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="SR-IOV Virtual Function (not to be confused with virtual network function)",indexedProps="pci-id,vf-vlan-filter,vf-mac-filter,vf-vlan-strip,neutron-network-id",dependentOn="l-interface",container="sriov-vfs")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="pci-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="PCI ID used to identify the sriov-vf")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-vlan-filter" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This metadata provides option to specify list of VLAN filters applied on VF to pass the traffic to VM.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-mac-filter" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="When MAC filters are specified, VF-agent service configures VFs to do MAC level filtering before the traffic is passed to VM.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-vlan-strip" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="When this field is set to true, VF will configured to strip the outer TAG before the traffic is passed to VM.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-vlan-anti-spoof-check" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-mac-anti-spoof-check" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-mirrors" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This option defines the set of Mirror objects which essentially mirrors the traffic from source to set of collector VNF Ports.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-broadcast-allow" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows all broadcast traffic to reach the VM")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-unknown-multicast-allow" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows unknown multicast traffic to reach the VM")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-unknown-unicast-allow" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows unknown unicast traffic to reach the VM")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-insert-stag" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This option, if set to true, instructs to insert outer tag after traffic comes out of VM.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-link-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This option is used to set the link status. Valid values as of 1607 are on, off, and auto.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-network-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron network id of the interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="sriov-vfs"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of SR-IOV Virtual Functions.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:sriov-vf" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="l-interface"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Logical interfaces, e.g., a vnic.",indexedProps="macaddr,interface-id,interface-name,network-name",dependentOn="generic-vnf,newvce,vpe,p-interface,vserver,lag-interface",container="l-interfaces")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="interface-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Name given to the interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="E.g., CUSTOMER, UPLINK, etc.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="v6-wan-link-ip" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Questionably placed - v6 ip addr of this interface (is in vr-lan-interface from Mary B.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ID of interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="macaddr" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="MAC address for the interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of the network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="management-option" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Whether A&AI should be managing this interface of not. Could have value like CUSTOMER")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-description" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Human friendly text regarding this interface.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-port-mirrored" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this port is mirrored.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:l-interfaces" minOccurs="0"/> + <xs:element ref="tns:vlans" minOccurs="0"/> + <xs:element ref="tns:sriov-vfs" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:l3-interface-ipv4-address-list" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="tns:l3-interface-ipv6-address-list" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="l-interfaces"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of logical interfaces.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:l-interface" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vserver"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Virtual Servers, aka virtual machine or VM.",nameProps="vserver-name",indexedProps="is-closed-loop-disabled,prov-status,vserver-name,vserver-id,in-maint,vserver-name2",searchable="vserver-id,vserver-name,vserver-name2",dependentOn="tenant",container="vservers")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vserver-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier for this vserver relative to its tenant")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vserver-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of vserver")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vserver-name2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Alternative name of vserver")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vserver-selflink" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="in-maint" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-closed-loop-disabled" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Used to indicate whether closed loop function is enabled on this node")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:volumes" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:l-interfaces" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vservers"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of virtual Servers, aka virtual machines or VMs.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:vserver" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="tenant"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Openstack tenant",nameProps="tenant-name",indexedProps="tenant-name,tenant-id",searchable="tenant-id,tenant-name",dependentOn="cloud-region",container="tenants")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="tenant-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id relative to the cloud-region.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="tenant-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Readable name of tenant")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:vservers" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="tenants"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of openstack tenants.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:tenant" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="flavor"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Openstack flavor.",nameProps="flavor-name",indexedProps="flavor-name,flavor-id",dependentOn="cloud-region",container="flavors")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="flavor-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Flavor id, expected to be unique across cloud-region.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Flavor name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-vcpus" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Number of CPUs")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-ram" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Amount of memory")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-disk" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Disk space")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-ephemeral" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Amount of ephemeral disk space")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-swap" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="amount of swap space allocation")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-is-public" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="whether flavor is available to all users or private to the tenant it was created in.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-selflink" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="flavor-disabled" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Boolean as to whether this flavor is no longer enabled")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="flavors"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of openstack flavors.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:flavor" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="group-assignment"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Openstack group-assignment used to store exclusivity groups (EG).",nameProps="group-name",indexedProps="group-id,group-type,group-name",dependentOn="cloud-region",container="group-assignments")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="group-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Group id, expected to be unique across cloud-region.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="group-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Group type - the type of group this instance refers to")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="group-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Group name - name assigned to the group")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="group-description" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Group description - description of the group")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="group-assignments"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of openstack group assignments")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:group-assignment" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="snapshot"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Openstack snapshot",nameProps="snapshot-name",uniqueProps="snapshot-id",indexedProps="application,snapshot-name,application-vendor,snapshot-id,application-version,prev-snapshot-id",dependentOn="cloud-region",container="snapshots")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="snapshot-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Snapshot id, this is the key UUID assoc associated in glance with the snapshots.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="snapshot-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Snapshot name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="snapshot-architecture" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Operating system architecture")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="snapshot-os-distro" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The common name of the operating system distribution in lowercase")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="snapshot-os-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The operating system version as specified by the distributor.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The application that the image instantiates.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application-vendor" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The vendor of the application.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The version of the application.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="snapshot-selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prev-snapshot-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This field contains the UUID of the previous snapshot (if any).")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="snapshots"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of openstack snapshots")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:snapshot" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="metadatum"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Key/value pairs",indexedProps="metaname",dependentOn="tenant,image,service-instance,connector,model",container="metadata")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="metaname" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true)</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="metaval" type="xs:string"/> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="metadata"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of metadatum (key/value pairs)")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:metadatum" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="image"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Openstack image.",nameProps="image-name",indexedProps="application,image-name,application-vendor,image-id,application-version",dependentOn="cloud-region",container="images")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="image-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Image id, expected to be unique across cloud region")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="image-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Image name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="image-architecture" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Operating system architecture.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="image-os-distro" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The common name of the operating system distribution in lowercase")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="image-os-version" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The operating system version as specified by the distributor.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The application that the image instantiates.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application-vendor" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The vendor of the application.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The version of the application.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="image-selflink" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:metadata" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="images"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collectio of Openstack images.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:image" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="availability-zones"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of availability zones")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:availability-zone" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="cloud-region"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="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. It's important to note that the cloud-region data is not updated once created, so there is a potential for the data to become stale.",indexedProps="cloud-owner,cloud-region-id,cloud-type,owner-defined-type",nameProps="owner-defined-type",container="cloud-regions",namespace="cloud-infrastructure")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="cloud-owner" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Identifies the vendor and cloud name, e.g., att-aic. First part of composite key should be formatted as vendor-cloudname")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="cloud-region-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Identifier used by the vendor for the region. Second part of composite key")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="cloud-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Type of the cloud (e.g., openstack)")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="owner-defined-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Cloud-owner defined type indicator (e.g., dcp, lcp)")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="cloud-region-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Software version employed at the site. NOTE - THIS FIELD IS NOT KEPT UP TO DATE.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="identity-url" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL of the keystone identity service")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="cloud-zone" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Zone where the cloud is homed. NOTE - THIS FIELD IS NOT CORRECTLY POPULATED.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="complex-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="complex name for cloud-region instance. NOTE - THIS FIELD IS NOT CORRECTLY POPULATED.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:volume-groups" minOccurs="0"/> + <xs:element ref="tns:tenants" minOccurs="0"/> + <xs:element ref="tns:flavors" minOccurs="0"/> + <xs:element ref="tns:group-assignments" minOccurs="0"/> + <xs:element ref="tns:snapshots" minOccurs="0"/> + <xs:element ref="tns:images" minOccurs="0"/> + <xs:element ref="tns:dvs-switches" minOccurs="0"/> + <xs:element ref="tns:oam-networks" minOccurs="0"/> + <xs:element ref="tns:availability-zones" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="cloud-regions"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(maximumDepth="0")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:cloud-region" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="network-profile"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Network profile populated by SDN-GP for SNMP",indexedProps="nm-profile-name",container="network-profiles",namespace="cloud-infrastructure")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="nm-profile-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique name of network profile.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="community-string" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Encrypted SNMP community string")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="network-profiles"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of network profiles")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:network-profile" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="p-interface"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Physical interface (e.g., nic)",indexedProps="interface-name,prov-status",nameProps="prov-status",dependentOn="vpls-pe,pserver,pnf",container="p-interfaces")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="interface-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Name that identifies the physical interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-value" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-units" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="port-description" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Nature of the services and connectivity on this port.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equipment-identifier" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="CLEI or other specification for p-interface hardware.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Role specification for p-interface hardware.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Indicates the physical properties of the interface.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:l-interfaces" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="p-interfaces"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of physical interfaces.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:p-interface" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="lag-interface"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Link aggregate interface",indexedProps="interface-name,interface-id,interface-role",dependentOn="generic-vnf,pserver,vpe,vpls-pe,pnf",container="lag-interfaces")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="interface-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Name that identifies the link aggregate interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-description" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Human friendly text regarding this interface.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-value" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-units" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ID of interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Role assigned to this Interface, should use values as defined in ECOMP Yang models.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:l-interfaces" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="lag-interfaces"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of link aggregate interfaces.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:lag-interface" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="pserver"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Compute host whose hostname must be unique and must exactly match what is sent as a relationship to a vserver.",nameProps="pserver-name2",indexedProps="hostname,in-maint,pserver-id,pserver-name2,inv-status",searchable="hostname,pserver-name2,pserver-id,ipv4-oam-address",container="pservers",namespace="cloud-infrastructure")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="hostname" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Value from executing hostname on the compute node.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ptnii-equip-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="PTNII name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="number-of-cpus" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Number of cpus")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="disk-in-gigabytes" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Disk size, in GBs")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ram-in-megabytes" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="RAM size, in MBs")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equip-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Equipment type. Source of truth should define valid values.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equip-vendor" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Equipment vendor. Source of truth should define valid values.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equip-model" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Equipment model. Source of truth should define valid values.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="fqdn" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Fully-qualified domain name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="pserver-selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used to configure device, also used for troubleshooting and is IP used for traps generated by device.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="serial-number" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Serial number, may be queried")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v4-loopback-0" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV4 Loopback 0 address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v6-loopback-0" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV6 Loopback 0 address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v4-aim" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV4 AIM address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v6-aim" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV6 AIM address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v6-oam" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV6 OAM address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="inv-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="CANOPI's inventory status. Only set with values exactly as defined by CANOPI.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="pserver-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ID of Pserver")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="internet-topology" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="internet topology of Pserver")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="in-maint" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="pserver-name2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="alternative pserver name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="purpose" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="purpose of pserver")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:p-interfaces" minOccurs="0"/> + <xs:element ref="tns:lag-interfaces" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="pservers"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of compute hosts.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:pserver" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="virtual-data-center"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Virtual organization of cloud infrastructure elements in a data center context",nameProps="vdc-name",indexedProps="vdc-name,vdc-id",container="virtual-data-centers",namespace="cloud-infrastructure")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vdc-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of the vdc")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vdc-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of the virtual data center")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="virtual-data-centers"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Virtual organization of cloud infrastructure elements in a data center context")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:virtual-data-center" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="cloud-infrastructure"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Namespace for cloud infrastructure.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:complexes" minOccurs="0"/> + <xs:element ref="tns:cloud-regions" minOccurs="0"/> + <xs:element ref="tns:network-profiles" minOccurs="0"/> + <xs:element ref="tns:pservers" minOccurs="0"/> + <xs:element ref="tns:virtual-data-centers" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="connector"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of resource instances used to connect a variety of disparate inventory widgets",indexedProps="resource-instance-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version",container="connectors",namespace="business")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="resource-instance-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of resource instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-invariant-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:metadata" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="connectors"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of resource instances used to connect a variety of disparate inventory widgets")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:connector" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="tunnel-xconnect"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Represents the specifics of a tunnel cross connect piece of a resource that gets separately allotted",uniqueProps="id",indexedProps="id",dependentOn="allotted-resource",container="tunnel-xconnects")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Allotted Resource id UUID assigned to this instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-up-wan1" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The WAN uplink bandwidth for WAN1")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-down-wan1" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The WAN downlink bandwidth for WAN1")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-up-wan2" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The WAN uplink bandwidth for WAN2")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-down-wan2" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The WAN downlink bandwidth for WAN2")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Concurrency value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="tunnel-xconnects"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="This object is used to store the specific tunnel cross connect aspects of an allotted resource")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:tunnel-xconnect" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="allotted-resource"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Represents a slice or partial piece of a resource that gets separately allotted",nameProps="description",uniqueProps="id",indexedProps="id,model-invariant-id,model-version-id,type,role",dependentOn="service-instance",container="allotted-resources")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Allotted Resource id UUID assigned to this instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="description" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The descriptive information assigned to this allotted resource instance")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Link back to more information in the controller")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-invariant-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-customization-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this resource, mastered by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="operational-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Concurrency value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Generic description of the type of the resource")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Role that this asset will be playing in its context.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:tunnel-xconnects" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="allotted-resources"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="This object is used to store slices of services being offered")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:allotted-resource" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="service-instance"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Instance of a service",indexedProps="service-instance-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,service-instance-name,service-instance-location-id,orchestration-status",nameProps="service-instance-name",searchable="service-instance-id,service-instance-name",uniqueProps="service-instance-id",dependentOn="service-subscription",container="service-instances")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="service-instance-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Uniquely identifies this instance of a service")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-instance-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This field will store a name assigned to the service-instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-invariant-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-total" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Indicates the total bandwidth to be used for this service.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-up-wan1" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="indicates the upstream bandwidth this service will use on the WAN1 port of the physical device.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-down-wan1" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="indicates the downstream bandwidth this service will use on the WAN1 port of the physical device.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-up-wan2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="indicates the upstream bandwidth this service will use on the WAN2 port of the physical device.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="bandwidth-down-wan2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="indicates the downstream bandwidth this service will use on the WAN2 port of the physical device.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vhn-portal-url" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL customers will use to access the vHN Portal.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-instance-location-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="An identifier that customers assign to the location where this service is being used.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Path to the controller object.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this service.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:metadata" minOccurs="0"/> + <xs:element ref="tns:allotted-resources" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="service-instances"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of service instances")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:service-instance" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="service-subscription"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Object that group service instances.",indexedProps="service-type",dependentOn="customer",container="service-subscriptions",crossEntityReference="service-instance,service-type")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="service-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Value defined by orchestration to identify this service across ECOMP.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="temp-ub-sub-account-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="This property will be deleted from A&AI in the near future. Only stop gap solution.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:service-instances" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="service-subscriptions"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of objects that group service instances.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:service-subscription" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="customer"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="customer identifiers to provide linkage back to BSS information.",nameProps="subscriber-name",indexedProps="subscriber-name,global-customer-id,subscriber-type",searchable="global-customer-id,subscriber-name",uniqueProps="global-customer-id",container="customers",namespace="business")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="global-customer-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Global customer id used across ECOMP to uniquely identify customer.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="subscriber-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Subscriber name, an alternate way to retrieve a customer.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="subscriber-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Subscriber type, a way to provide VID with only the INFRA customers.",defaultValue="CUST")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:service-subscriptions" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="customers"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of customer identifiers to provide linkage back to BSS information.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:customer" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="business"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Namespace for business related constructs")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:connectors" minOccurs="0"/> + <xs:element ref="tns:customers" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vnf-image"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Image object that pertain to a VNF that doesn't have associated vservers. This is a kludge.",indexedProps="application,att-uuid,application-vendor,application-version",uniqueProps="att-uuid",container="vnf-images",namespace="service-design-and-creation")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="att-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of this asset")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The application that the image instantiates.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application-vendor" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The vendor of the application.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="application-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The version of the application.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vnf-images"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of image objects that pertain to a VNF that doesn't have associated vservers. This is a kludge.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:vnf-image" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="service"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Stand-in for service model definitions. Likely to be deprecated in favor of models from ASDC. Does not strictly map to ASDC services.",indexedProps="service-description,service-id",container="services",namespace="service-design-and-creation")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="service-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="This gets defined by others to provide a unique ID for the service, we accept what is sent.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-description" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Description of the service")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="service version")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="services"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of service model definitions. Likely to be deprecated in favor of models from ASDC.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:service" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="service-capability"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Early definition of server/resource pairings, likely to be replaced by models. No new use should be made of this.",indexedProps="service-type,vnf-type",container="service-capabilities",namespace="service-design-and-creation")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="service-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="This gets defined by others to provide a unique ID for the service, we accept what is sent.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="service-capabilities"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of service capabilities.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:service-capability" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="element-choice-set"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="element-choice-set-uuid",indexedProps="element-choice-set-uuid",allowDirectRead="true",allowDirectWrite="false",container="element-choice-sets")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="element-choice-set-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="element-choice-set-name" type="xs:string"/> + <xs:element name="cardinality" type="xs:string" minOccurs="0"/> + <xs:element name="resource-version" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:model-elements" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="element-choice-sets"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:element-choice-set" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="constrained-element-set"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="constrained-element-set-uuid",indexedProps="constrained-element-set-uuid",allowDirectRead="true",allowDirectWrite="false",container="constrained-element-sets")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="constrained-element-set-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="constraint-type" type="xs:string"/> + <xs:element name="check-type" type="xs:string"/> + <xs:element name="resource-version" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:element-choice-sets" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="constrained-element-sets"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:constrained-element-set" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="model-constraint"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="model-constraint-uuid",indexedProps="model-constraint-uuid",allowDirectRead="true",allowDirectWrite="false",container="model-constraints")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="model-constraint-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="constrained-element-set-uuid-to-replace" type="xs:string"/> + <xs:element ref="tns:constrained-element-sets" minOccurs="0"/> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="model-constraints"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:model-constraint" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="model-element"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Defines how other models combine to make up a higher-level model.",uniqueProps="model-element-uuid",indexedProps="model-element-uuid",allowDirectRead="true",allowDirectWrite="false",container="model-elements")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="model-element-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="new-data-del-flag" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Indicates whether this element was created as part of instantiation from this model")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="cardinality" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="How many of this type of element are required/allowed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="linkage-points" minOccurs="0"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Defines how other models combine to make up a higher-level model.",uniqueProps="model-element-uuid",indexedProps="model-element-uuid",allowDirectRead="true",allowDirectWrite="false",container="model-elements")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="linkage-point" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:model-elements" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Defines how other models combine to make up a higher-level model")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:model-constraints" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Describes new constraints on this model element that are not part of that model's definition")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="model-elements"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:model-element" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="model-ver"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Subgraph definition provided by ASDC to describe a specific version of an inventory asset and its connections related to ASDC models",nameProps="model-name",indexedProps="model-version-id,model-name,model-version",uniqueProps="model-version-id",container="model-vers")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="model-version-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to one version of a model in ASDC")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of the model, which can change from version to version.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Version")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-description" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Description")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:model-elements" minOccurs="0"/> + <xs:element ref="tns:metadata" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="model-vers"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:model-ver" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="model"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Subgraph definition provided by ASDC to describe an inventory asset and its connections related to ASDC models, independent of version",nameProps="model-type",indexedProps="model-invariant-id,model-type",uniqueProps="model-invariant-id",container="models",namespace="service-design-and-creation")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="model-invariant-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to the main definition of a model in ASDC")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Type of the model, e.g., service, resource, widget, etc.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:model-vers" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="models"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of subgraph definitions provided by ASDC to describe the inventory assets and their connections related to ASDC models")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:model" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="related-lookup"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="TBD",uniqueProps="related-lookup-uuid",indexedProps="related-lookup-uuid",allowDirectRead="true",allowDirectWrite="false",container="related-lookups")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="related-lookup-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="source-node-type" type="xs:string"/> + <xs:element name="source-node-property" type="xs:string"/> + <xs:element name="target-node-type" type="xs:string"/> + <xs:element name="target-node-property" type="xs:string"/> + <xs:element name="property-collect-list" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="resource-version" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="related-lookups"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:related-lookup" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="property-constraint"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="TBD",uniqueProps="property-constraint-uuid",indexedProps="property-constraint-uuid",allowDirectRead="true",allowDirectWrite="false",container="property-constraints")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="property-constraint-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="constraint-type" type="xs:string"/> + <xs:element name="property-name" type="xs:string"/> + <xs:element name="property-value" type="xs:string"/> + <xs:element name="resource-version" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="property-constraints"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:property-constraint" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="named-query-element"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="TBD",uniqueProps="named-query-element-uuid",indexedProps="named-query-element-uuid",allowDirectRead="true",allowDirectWrite="false",container="named-query-elements")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="named-query-element-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="property-collect-list" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="resource-version" type="xs:string" minOccurs="0"/> + <xs:element name="property-limit-desc" type="xs:string" minOccurs="0"/> + <xs:element name="do-not-output" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:named-query-elements" minOccurs="0"/> + <xs:element ref="tns:related-lookups" minOccurs="0"/> + <xs:element ref="tns:property-constraints" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="named-query-elements"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:named-query-element" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="named-query"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="TBD",nameProps="named-query-name",uniqueProps="named-query-uuid",indexedProps="named-query-uuid,named-query-name",container="named-queries",namespace="service-design-and-creation")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="named-query-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true)</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="named-query-name" type="xs:string"/> + <xs:element name="named-query-version" type="xs:string"/> + <xs:element name="required-input-params" minOccurs="0"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="TBD",nameProps="named-query-name",uniqueProps="named-query-uuid",indexedProps="named-query-uuid,named-query-name",container="named-queries",namespace="service-design-and-creation")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="required-input-param" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="description" type="xs:string" minOccurs="0"/> + <xs:element name="resource-version" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:named-query-elements" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="named-queries"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:named-query" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="service-design-and-creation"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Namespace for objects managed by ASDC")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:vnf-images" minOccurs="0"/> + <xs:element ref="tns:services" minOccurs="0"/> + <xs:element ref="tns:service-capabilities" minOccurs="0"/> + <xs:element ref="tns:models" minOccurs="0"/> + <xs:element ref="tns:named-queries" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="logical-link"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Logical links generally connect l-interfaces but are used to express logical connectivity between two points",indexedProps="link-name,model-invariant-id,model-version-id,widget-model-id,widget-model-version,link-id,prov-status,circuit-id,purpose",uniqueProps="link-id",container="logical-links",namespace="network",searchable="link-name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="link-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="e.g., evc-name, or vnf-nameA_interface-nameA_vnf-nameZ_interface-nameZ")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="link-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Type of logical link, e.g., evc")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-value" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-units" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ip-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="v4, v6, or ds for dual stack (should be att-ip-version)")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="routing-protocol" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="For example, static or BGP")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-invariant-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="operational-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="link-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Indication of the network use of the logical link.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="link-name2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Alias or alternate name (CLCI or D1 name).")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="link-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="UUID of the logical-link, SDNC generates this.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="circuit-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Circuit id")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="purpose" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Reason for this entity, role it is playing")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="logical-links"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of logical connections")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:logical-link" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="class-of-service"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(indexedProps="cos",dependentOn="site-pair",container="classes-of-service")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="cos" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="unique identifier of probe")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="probe-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="identifier of probe")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="probe-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="type of probe")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="classes-of-service"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="class-of-service of probe")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:class-of-service" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="site-pair"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(indexedProps="site-pair-id",uniqueProps="site-pair-id",dependentOn="routing-instance",container="site-pairs")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="site-pair-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="unique identifier of probe")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="source-ip" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Prefix address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="destination-ip" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Prefix address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ip-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ip version, v4, v6")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="destination-hostname" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Hostname of the destination equipment to which SLAs are measured against.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="destination-equip-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The type of destinatination equipment. Could be Router, UCPE, etc.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:classes-of-service" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="site-pairs"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="probe within a set")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:site-pair" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="routing-instance"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(indexedProps="routing-instance-id",uniqueProps="routing-instance-id",dependentOn="site-pair-set",container="routing-instances")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="routing-instance-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of routing instance")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="rpm-owner" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="rpm owner")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:site-pairs" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="routing-instances"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="set of probes related to generic-vnf routing instance")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:routing-instance" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="site-pair-set"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Set of instances for probes used to measure service level agreements",indexedProps="site-pair-set-id",uniqueProps="site-pair-set-id",container="site-pair-sets",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="site-pair-set-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of site pair set.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:routing-instances" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="site-pair-sets"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of sets of instances for probes related to generic-vnf")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:site-pair-set" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="route-target"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="stores the global route targets associated with a VPN",indexedProps="global-route-target,route-target-role",searchable="global-route-target",container="route-targets",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="global-route-target" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Number used to identify an RT, globally unique in the network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="route-target-role" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Role assigned to this route target, valid values EXPORT/IMPORT/BOTH")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Relationship to other objects")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="route-targets"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:route-target" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vpn-binding"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="VPN binding",nameProps="vpn-name,vpn-type",indexedProps="vpn-name,vpn-id,global-route-target,vpn-type",searchable="vpn-id,vpn-name",uniqueProps="vpn-id",container="vpn-bindings",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vpn-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="VPN ID, globally unique within A&AI")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vpn-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="VPN Name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="global-route-target" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Number used to identify a VPN, globally unique in the network. NOTE - WILL BE RETIRED IN 1802, see child object")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vpn-platform" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the platform associated with the VPN example AVPN, Mobility")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vpn-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Type of the vpn, should be taken from enumerated/valid values")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="route-distinguisher" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used to distinguish the distinct VPN routes of separate customers who connect to the provider in an MPLS network.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="route-target-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Role assigned to this route target. NOTE - WILL BE RETIRED IN 1802, see child object")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:route-targets" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="l3-networks relate to vpn-bindings")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vpn-bindings"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:vpn-binding" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vpls-pe"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="VPLS Provider Edge routers.",indexedProps="prov-status,equipment-name",container="vpls-pes",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="equipment-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true)</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equipment-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Client should send valid enumerated value, e.g., VPLS-PE.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-id-outer" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Temporary location for stag to get to VCE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:p-interfaces" minOccurs="0"/> + <xs:element ref="tns:lag-interfaces" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vpls-pes"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of VPLS Provider Edge routers")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:vpls-pe" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="multicast-configuration"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(indexedProps="multicast-configuration-id",uniqueProps="multicast-configuration-id",container="multicast-configurations",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="multicast-configuration-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of multicast configuration.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="multicast-protocol" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="protocol of multicast configuration")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="rp-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="rp type of multicast configuration")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="multicast-configurations"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="multicast configuration of generic-vnf ip-address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:multicast-configuration" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="cvlan-tag-entry"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(dependentOn="port-group",indexedProps="cvlan-tag",container="cvlan-tags")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="cvlan-tag" type="xs:unsignedInt"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="See mis-na-virtualization-platform.yang")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="cvlan-tags"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:cvlan-tag-entry" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="port-group"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Used to capture the network interfaces of this VCE",nameProps="port-group-name",indexedProps="port-group-id,heat-stack-id,interface-id,interface-name,switch-name",dependentOn="vce",container="port-groups")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="interface-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of the interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-network-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron network id of this Interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-network-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron network name of this Interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="interface-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Role assigned to this Interface, should use values as defined in ECOMP Yang models.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="port-group-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Unique ID for port group in vmware")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="port-group-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Likely to duplicate value of neutron network name")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="switch-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="DVS or standard switch name (should be non-null for port groups associated with DVS)")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="mso-catalog-key" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:cvlan-tags" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="port-groups"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:port-group" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="license"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Metadata for license group.",indexedProps="group-uuid,resource-uuid",dependentOn="generic-vnf,vce,vpe",container="licenses")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="group-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID for the license group the resource belongs to, should be uuid.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of a license resource. ")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Concurrency value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="licenses"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Licenses to be allocated across resources, keyed by group-uuid and resource-uuid, related to license management")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:license" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="entitlement"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Metadata for entitlement group.",indexedProps="group-uuid,resource-uuid",dependentOn="generic-vnf,vce,vpe",container="entitlements")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="group-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID for the entitlement group the resource comes from, should be uuid.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-uuid" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of an entitlement resource. ")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Concurrency value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="entitlements"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Entitlements, keyed by group-uuid and resource-uuid, related to license management")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:entitlement" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vce"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Virtual Customer Edge Router, used specifically for Gamma. This object is deprecated.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,interface-name,regional-resource-zone,vpe-id,prov-status,service-id",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="vces",namespace="network",extendsFrom="vnf")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vnf-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of VNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-name2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Alternate name of VNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Unique identifier of service, does not strictly map to ASDC services, SOON TO BE DEPRECATED.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="regional-resource-zone" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="operational-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equipment-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Network role being played by this VNF")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="mso-catalog-key" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vpe-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Unique ID of VPE connected to this VCE.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="v6-vce-wan-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Valid v6 IP address for the WAN Link on this router. Implied length of /64.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure vce, also used for troubleshooting and is IP used for traps generated by VCE.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-loopback0-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Loopback0 address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:port-groups" minOccurs="0"/> + <xs:element ref="tns:licenses" minOccurs="0"/> + <xs:element ref="tns:entitlements" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vces"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of Virtual Customer Edge Routers, used specifically for Gamma. This object is deprecated.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:vce" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vpe"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Relationship-list must include related to info for complex.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,regional-resource-zone,prov-status,service-id",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="vpes",namespace="network",extendsFrom="vnf")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vnf-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of VNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-name2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Alternate name of VNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Unique identifier of service. Does not map strictly to ASDC services. SOON TO BE DEPRECATED")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="regional-resource-zone" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="operational-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equipment-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Client should send valid enumerated value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="mso-catalog-key" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-gateway-address-prefix-length" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Prefix length for oam-address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-gateway-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Gateway address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="v4-loopback0-ip-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Loopback0 address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vlan-id-outer" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Temporary location for stag to get to VCE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="as-number" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="as-number of the VPE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="summary-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="details regarding the vpe operation, PLEASE DISCONTINUE USE OF THIS FIELD.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="encrypted-access-flag" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="indicates whether vpe access uses SSH")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:l-interfaces" minOccurs="0"/> + <xs:element ref="tns:lag-interfaces" minOccurs="0"/> + <xs:element ref="tns:licenses" minOccurs="0"/> + <xs:element ref="tns:entitlements" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vpes"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Virtual provider edge router. In 1504, A&AI will populate this object through an M&P and tool provided to operations.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:vpe" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vnfc"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(indexedProps="vnfc-name,prov-status,vnfc-type,vnfc-function-code,ipaddress-v4-oam-vip,in-maint,is-closed-loop-disabled,group-notation",searchable="vnfc-name",container="vnfcs",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vnfc-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of vnfc.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnfc-function-code" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="function code")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnfc-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="type")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="prov status of this vnfc")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by APP-C")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v4-oam-vip" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Oam V4 vip address of this vnfc")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="in-maint" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-closed-loop-disabled" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether closed loop function is enabled on this node")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="group-notation" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Group notation of VNFC")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vnfcs"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="virtual network components associated with a vserver from application controller.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:vnfc" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="subnet"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(indexedProps="subnet-id,subnet-name",nameProps="subnet-name",uniqueProps="subnet-id",dependentOn="l3-network",container="subnets")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="subnet-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Subnet ID, should be UUID.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="subnet-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name associated with the subnet.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-subnet-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron id of this subnet")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="gateway-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="gateway ip address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-start-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="network start address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="cidr-mask" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="cidr mask")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ip-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ip version")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="dhcp-enabled" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="dhcp enabled")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="dhcp-start" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the start address reserved for use by dhcp")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="dhcp-end" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the last address reserved for use by dhcp")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="subnets"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:subnet" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="ctag-assignment"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(indexedProps="vlan-id-inner",dependentOn="l3-network",container="ctag-assignments")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vlan-id-inner" type="xs:unsignedInt"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="id.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="ctag-assignments"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:ctag-assignment" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="segmentation-assignment"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Openstack segmentation assignment.",indexedProps="segmentation-id",dependentOn="l3-network",container="segmentation-assignments")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="segmentation-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Route Table Reference id, UUID assigned to this instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Concurrency value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="segmentation-assignments"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of openstack segmentation assignments")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:segmentation-assignment" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="l3-network"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Generic network definition",nameProps="network-name",indexedProps="heat-stack-id,network-uuid,service-id,network-id,network-name,model-invariant-id,model-version-id,widget-model-id,widget-model-version,contrail-network-fqdn,network-role",searchable="network-id,network-name",uniqueProps="network-id",container="l3-networks",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="network-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Network ID, should be uuid. Unique across A&AI.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of the network, governed by some naming convention..")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Type of the network - who defines these values?")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Role the network plans - who defines these values?")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-technology" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Network technology - who defines these values?")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="neutron-network-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Neutron network id of this Interface")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-bound-to-vpn" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Set to true if bound to VPN")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Unique identifier of service from ASDC. Does not strictly map to ASDC services. SOON TO BE DEPRECATED")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-role-instance" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="network role instance")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="mso-catalog-key" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="contrail-network-fqdn" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Contrail FQDN for the network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-invariant-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-customization-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="physical-network-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name associated with the physical network.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-provider-network" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is a provider network.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-shared-network" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is a shared network.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-external-network" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is an external network.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="operational-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Path to the controller object.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:subnets" minOccurs="0"/> + <xs:element ref="tns:ctag-assignments" minOccurs="0"/> + <xs:element ref="tns:segmentation-assignments" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Relates to tenant (or is it a child of tenant), complex, service, vpn-binding")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="l3-networks"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:l3-network" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="network-policy"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(nameProps="network-policy-fqdn",indexedProps="network-policy-id,network-policy-fqdn",searchable="network-policy-id,network-policy-fqdn",uniqueProps="network-policy-id",container="network-policies",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="network-policy-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="UUID representing unique key to this instance")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="network-policy-fqdn" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Contrail FQDN for the policy")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ID for the openStack Heat instance")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="network-policies"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:network-policy" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vf-module"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="a deployment unit of VNFCs",indexedProps="vf-module-id,vf-module-name,heat-stack-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,contrail-service-instance-fqdn",searchable="vf-module-id,vf-module-name",dependentOn="generic-vnf",container="vf-modules")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vf-module-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of vf-module.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vf-module-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of vf-module")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="orchestration status of this vf-module, mastered by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-base-vf-module" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is base vf module")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-invariant-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-customization-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="contrail-service-instance-fqdn" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the Contrail unique ID for a service-instance")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="module-index" type="xs:int" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="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")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Path to the controller object.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vf-modules"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of vf-modules, a deployment unit of VNFCs")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:vf-module" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="generic-vnf"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="General purpose VNF",nameProps="vnf-name",indexedProps="is-closed-loop-disabled,vnf-name2,vnf-type,heat-stack-id,in-maint,vnf-name,vnf-id,regional-resource-zone,prov-status,service-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,nf-type,nf-role,nf-function,nf-naming-code",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="generic-vnfs",namespace="network",extendsFrom="vnf")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vnf-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of VNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-name2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Alternate name of VNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Unique identifier of service, does not necessarily map to ASDC service models. SOON TO BE DEPRECATED")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="regional-resource-zone" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="operational-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equipment-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Client should send valid enumerated value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, used by MSO.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="mso-catalog-key" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="management-option" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="identifier of managed by ATT or customer")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure generic-vnf, also used for troubleshooting and is IP used for traps generated by generic-vnf.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-loopback0-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="v4 Loopback0 address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="nm-lan-v6-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="v6 Loopback address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="management-v6-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="v6 management address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vcpu" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="number of vcpus ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only by uCPE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vcpu-units" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="units associated with vcpu, used for VNFs with no vservers/flavors, to be used only by uCPE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vmemory" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="number of GB of memory ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only by uCPE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vmemory-units" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="units associated with vmemory, used for VNFs with no vservers/flavors, to be used only by uCPE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vdisk" type="xs:unsignedInt" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="number of vdisks ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only uCPE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vdisk-units" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="units associated with vdisk, used for VNFs with no vservers/flavors, to be used only by uCPE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="in-maint" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="is-closed-loop-disabled" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether closed loop function is enabled on this node")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="summary-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="details regarding the generic-vnf operation, PLEASE DISCONTINUE USE OF THIS FIELD.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="encrypted-access-flag" type="xs:boolean" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="indicates whether generic-vnf access uses SSH")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-invariant-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-customization-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="widget-model-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="as-number" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="as-number of the VNF")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="regional-resource-subzone" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="represents sub zone of the rr plane")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="nf-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Generic description of the type of the resource")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="nf-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Role that this asset will be playing in its context.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="nf-function" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="English description of function that the specific resource deployment is providing. Assigned as part of the customization of a resource in a service")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="nf-naming-code" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Short code that is used in naming instances of the item being modelled")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="selflink" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Path to the controller object.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:l-interfaces" minOccurs="0"/> + <xs:element ref="tns:lag-interfaces" minOccurs="0"/> + <xs:element ref="tns:vf-modules" minOccurs="0"/> + <xs:element ref="tns:licenses" minOccurs="0"/> + <xs:element ref="tns:entitlements" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="generic-vnfs"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of VNFs")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:generic-vnf" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="lag-link"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="LAG links can connect lag-interfaces",indexedProps="link-name",container="lag-links",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="link-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Alphabetical concatenation of lag-interface names")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="lag-links"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of link aggregation connections")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:lag-link" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="newvce"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,prov-status,vnf-id2",searchable="vnf-id2,vnf-name,vnf-name2",uniqueProps="vnf-id2",container="newvces",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vnf-id2" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF, can't use same attribute name right now until we promote this new object")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of VNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-name2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Alternate name of VNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="vnf-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="operational-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="license-key" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="OBSOLETE - do not use")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-oam-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equipment-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Client should send valid enumerated value, e.g., VPE.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipv4-loopback0-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="v4 Loopback0 address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="orchestration-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="heat-stack-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="mso-catalog-key" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:l-interfaces" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="newvces"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:newvce" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="pnf"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="PNF represents a physical network function. typically equipment used in the D1 world. in 1607, this will be populated by SDN-C to represent a premises router that a uCPE connects to. But this can be used to represent any physical device that is not an AIC node or uCPE.",indexedProps="pnf-name,orchestration-status,inv-status",searchable="pnf-name",uniqueProps="pnf-name",container="pnfs",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="pnf-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="unique name of Physical Network Function.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="pnf-name2" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="name of Physical Network Function.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="pnf-name2-source" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="source of name2")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="pnf-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="id of pnf")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equip-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Equipment type. Source of truth should define valid values.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equip-vendor" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Equipment vendor. Source of truth should define valid values.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="equip-model" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Equipment model. Source of truth should define valid values.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="management-option" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="identifier of managed by ATT or customer")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v4-oam" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ipv4-oam-address with new naming convention for IP addresses")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="sw-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="sw-version is the version of SW for the hosted application on the PNF.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="in-maint" type="xs:boolean"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(defaultValue="false",description="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.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="frame-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ID of the physical frame (relay rack) where pnf is installed.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="serial-number" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Serial number of the device")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v4-loopback-0" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV4 Loopback 0 address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v6-loopback-0" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV6 Loopback 0 address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v4-aim" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV4 AIM address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v6-aim" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV6 AIM address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v6-oam" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="IPV6 OAM address")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="inv-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="CANOPI's inventory status. Only set with values exactly as defined by CANOPI.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="prov-status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="nf-role" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Nf Role is the role performed by this instance in the network.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:p-interfaces" minOccurs="0"/> + <xs:element ref="tns:lag-interfaces" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="pnfs"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of Physical Network Functions.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:pnf" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="physical-link"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of physical connections, typically between p-interfaces",indexedProps="circuit-id,link-name",alternateKeys1="circuit-id",container="physical-links",namespace="network",searchable="link-name,circuit-id")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="link-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="e.g., hostnameA_p-connection_nameA_hostnameZ+p_connection-nameZ")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-value" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="speed-units" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="circuit-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Circuit it")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="dual-mode" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Dual access mode (e.g., primary, secondary")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="management-option" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="To provide information on who manages this circuit. A&AI or 3rd party transport provider")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="service-provider-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of the service Provider on this link.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="physical-links"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of physical connections, typically between p-interfaces")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:physical-link" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vig-server"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="vig-server contains information about a vig server used for IPSec-configuration. Populated by SDN-C from 1607",indexedProps="vig-address-type",dependentOn="ipsec-configuration",container="vig-servers")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vig-address-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="indicates whether the VIG is for AVPN or INTERNET")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v4-vig" type="xs:string" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="v4 IP of the vig server")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipaddress-v6-vig" type="xs:string" minOccurs="0" maxOccurs="unbounded"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="v6 IP of the vig server")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vig-servers"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:vig-server" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="ipsec-configuration"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="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",indexedProps="ipsec-configuration-id",uniqueProps="ipsec-configuration-id",container="ipsec-configurations",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="ipsec-configuration-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="UUID of this configuration")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="requested-vig-address-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Indicate the type of VIG server like AVPN, INTERNET, BOTH")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="requested-encryption-strength" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Encryption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="requested-dmz-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="ATT can offer a shared DMZ or a DMZ specific to a customer")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="shared-dmz-network-address" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Network address of shared DMZ")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="requested-customer-name" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="If the DMZ is a custom DMZ, this field will indicate the customer information")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ike-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="can be 1 or 2")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ikev1-authentication" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Contains values like md5, sha1, sha256, sha384")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ikev1-encryption" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ikev1-dh-group" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Diffie-Hellman group like DH-GROUP2, DH-GROUP5, DH-GROUP14")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ikev1-am-group-id" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Group name defined in VIG for clients using aggressive mode")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ikev1-am-password" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="pre-shared key for the above group name ")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ikev1-sa-lifetime" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Lifetime for IKEv1 SA")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipsec-authentication" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="md5, sha1, sha256, sha384")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipsec-encryption" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipsec-sa-lifetime" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Life time for IPSec SA")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="ipsec-pfs" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="enable PFS or not")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="xauth-userid" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="user ID for xAuth, sm-user,ucpeHostName,nmteHostName")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="xauth-user-password" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Encrypted using the Juniper $9$ algorithm")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="dpd-interval" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="The time between DPD probe")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="dpd-frequency" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Maximum number of DPD before claiming the tunnel is down")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + <xs:element ref="tns:vig-servers" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="ipsec-configurations"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:ipsec-configuration" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="route-table-reference"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Openstack route table reference.",nameProps="route-table-reference-fqdn",uniqueProps="route-table-reference-id",indexedProps="route-table-reference-id,route-table-reference-fqdn",container="route-table-references",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="route-table-reference-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Route Table Reference id, UUID assigned to this instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="route-table-reference-fqdn" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="FQDN entry in the route table.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Concurrency value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="route-table-references"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of openstack route table references")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:route-table-reference" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="instance-group"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="General mechanism for grouping instances",nameProps="description",uniqueProps="id",indexedProps="id,description,type,sub-type",container="instance-groups",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Instance Group ID, UUID assigned to this instance.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="description" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Descriptive text to help identify the usage of this instance-group")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Only valid value today is lower case ha for high availability")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="sub-type" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Valid values for ha type are [geo-activeactive, geo-activestandby, local-activeactive, local-activestandby]")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Concurrency value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="instance-groups"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of openstack route table references")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:instance-group" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="zone"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="A zone is a grouping of assets in a location homing to the same connections into the CBB",nameProps="zone-name",indexedProps="zone-id,design-type,zone-context",uniqueProps="zone-id",container="zones",namespace="network")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="zone-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Code assigned by AIC to the zone")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="zone-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="English name associated with the zone")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="design-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Design of zone [Medium/Large…]")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="zone-context" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Context of zone [production/test]")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="status" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Status of a zone.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Concurrency value")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="zones"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Collection of zones")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:zone" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="network"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Namespace for network inventory resources.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:logical-links" minOccurs="0"/> + <xs:element ref="tns:site-pair-sets" minOccurs="0"/> + <xs:element ref="tns:vpn-bindings" minOccurs="0"/> + <xs:element ref="tns:vpls-pes" minOccurs="0"/> + <xs:element ref="tns:multicast-configurations" minOccurs="0"/> + <xs:element ref="tns:vces" minOccurs="0"/> + <xs:element ref="tns:vpes" minOccurs="0"/> + <xs:element ref="tns:vnfcs" minOccurs="0"/> + <xs:element ref="tns:l3-networks" minOccurs="0"/> + <xs:element ref="tns:network-policies" minOccurs="0"/> + <xs:element ref="tns:generic-vnfs" minOccurs="0"/> + <xs:element ref="tns:lag-links" minOccurs="0"/> + <xs:element ref="tns:newvces" minOccurs="0"/> + <xs:element ref="tns:pnfs" minOccurs="0"/> + <xs:element ref="tns:physical-links" minOccurs="0"/> + <xs:element ref="tns:ipsec-configurations" minOccurs="0"/> + <xs:element ref="tns:route-table-references" minOccurs="0"/> + <xs:element ref="tns:instance-groups" minOccurs="0"/> + <xs:element ref="tns:zones" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="reserved-prop-names"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Internal map to define some reserved properties of a vertex",uniqueProps="aai-unique-key",indexedProps="aai-unique-key,source-of-truth,aai-node-type,aai-uri")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="last-mod-source-of-truth" type="xs:string" minOccurs="0"/> + <xs:element name="aai-node-type" type="xs:string" minOccurs="0"/> + <xs:element name="aai-created-ts" type="xs:unsignedInt" minOccurs="0"/> + <xs:element name="aai-unique-key" type="xs:string" minOccurs="0"/> + <xs:element name="aai-last-mod-ts" type="xs:unsignedInt" minOccurs="0"/> + <xs:element name="source-of-truth" type="xs:string" minOccurs="0"/> + <xs:element name="aai-uri" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="edge-prop-names"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Internal map to define the properties of an edge and interpret the map EdgeRules",edgeInfo="edgeLabel,direction,multiplicityRule,isParent,usesResource,hasDelTarget,SVC-INFRA,SVC-INFRA-REV")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="edgeLabel" type="xs:string" minOccurs="0"/> + <xs:element name="direction" type="xs:string" minOccurs="0"/> + <xs:element name="multiplicityRule" type="xs:string" minOccurs="0"/> + <xs:element name="isParent" type="xs:boolean" minOccurs="0"/> + <xs:element name="usesResource" type="xs:boolean" minOccurs="0"/> + <xs:element name="hasDelTarget" type="xs:boolean" minOccurs="0"/> + <xs:element name="SVC-INFRA" type="xs:string" minOccurs="0"/> + <xs:element name="SVC-INFRA-REV" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="aai-internal"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:reserved-prop-names" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="tns:edge-prop-names" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="inventory"> + <xs:complexType> + <xs:sequence> + <xs:element ref="tns:search" minOccurs="0"/> + <xs:element ref="tns:actions" minOccurs="0"/> + <xs:element ref="tns:cloud-infrastructure" minOccurs="0"/> + <xs:element ref="tns:business" minOccurs="0"/> + <xs:element ref="tns:service-design-and-creation" minOccurs="0"/> + <xs:element ref="tns:network" minOccurs="0"/> + <xs:element ref="tns:aai-internal" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="notification-event-header"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" minOccurs="0"/> + <xs:element name="timestamp" type="xs:string" minOccurs="0"/> + <xs:element name="source-name" type="xs:string" minOccurs="0"/> + <xs:element name="domain" type="xs:string" minOccurs="0"/> + <xs:element name="sequence-number" type="xs:string" minOccurs="0"/> + <xs:element name="severity" type="xs:string" minOccurs="0"/> + <xs:element name="event-type" type="xs:string" minOccurs="0"/> + <xs:element name="version" type="xs:string" minOccurs="0"/> + <xs:element name="action" type="xs:string" minOccurs="0"/> + <xs:element name="entity-type" type="xs:string" minOccurs="0"/> + <xs:element name="top-entity-type" type="xs:string" minOccurs="0"/> + <xs:element name="entity-link" type="xs:string" minOccurs="0"/> + <xs:element name="status" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="notification-event"> + <xs:complexType> + <xs:sequence> + <xs:element name="cambria.partition" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:notification-event-header" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="overloaded-model"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Allows for legacy POST of old-style and new-style models")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="model-invariant-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to the main definition of a model in ASDC")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-name-version-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to one version of a model in ASDC")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-type" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Type of the model, e.g., service, resource, widget, etc.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-name" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Name of the model, which can change from version to version.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Invariant unique ID which does not change from version to version")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-version" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Version")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="model-description" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Description")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element name="resource-version" type="xs:string" minOccurs="0"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + <xs:element ref="tns:model-vers" minOccurs="0"/> + <xs:element ref="tns:relationship-list" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="query-parameters"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="QueryParameters for performing a named-query or model query")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:named-query" minOccurs="0"/> + <xs:element ref="tns:overloaded-model" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="instance-filter"> + <xs:complexType> + <xs:sequence/> + </xs:complexType> + </xs:element> + <xs:element name="instance-filters"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="InstanceFilters for performing a named-query or model query")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:instance-filter" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="secondary-filt"> + <xs:complexType> + <xs:sequence/> + </xs:complexType> + </xs:element> + <xs:element name="secondary-filts"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="SecondaryFilts for performing a named-query or model query")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:secondary-filt" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="model-and-named-query-search"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="ModelAndNamedQuerySearch holds query-parameters and instance-properties for performing a named-query or model query")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:query-parameters" minOccurs="0"/> + <xs:element ref="tns:instance-filters" minOccurs="0"/> + <xs:element ref="tns:secondary-filts" minOccurs="0"/> + <xs:element name="top-node-type" type="xs:string" minOccurs="0"/> + <xs:element name="secondary-filter-cut-point" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="properties"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Property holder for query properties or instance properties")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="property-name" type="xs:string" minOccurs="0"/> + <xs:element name="property-value" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="extra-properties"> + <xs:complexType> + <xs:sequence/> + </xs:complexType> + </xs:element> + <xs:element name="inventory-response-item"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Inventory item for response list",container="inventory-response-items")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:logical-link" minOccurs="0"/> + <xs:element ref="tns:pnf" minOccurs="0"/> + <xs:element ref="tns:p-interface" minOccurs="0"/> + <xs:element ref="tns:l3-network" minOccurs="0"/> + <xs:element ref="tns:generic-vnf" minOccurs="0"/> + <xs:element ref="tns:vserver" minOccurs="0"/> + <xs:element ref="tns:tenant" minOccurs="0"/> + <xs:element ref="tns:cloud-region" minOccurs="0"/> + <xs:element ref="tns:service-instance" minOccurs="0"/> + <xs:element name="model-name" type="xs:string" minOccurs="0"/> + <xs:element ref="tns:extra-properties" minOccurs="0"/> + <xs:element ref="tns:inventory-response-items" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="inventory-response-items"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Container for inventory items in response list",container="response-list")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:inventory-response-item" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="response-list"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Response container for the results of a named-query or model query")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element ref="tns:inventory-response-items" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="extra-property"> + <xs:complexType> + <xs:sequence> + <xs:element name="property-name" type="xs:string" minOccurs="0"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="vnf"> + <xs:complexType> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="class">@org.openecomp.aai.annotations.Metadata(description="Abstract vnf class",indexedProps="vnf-id",uniqueProps="vnf-id",inheritors="vce,vpe,generic-vnf",isAbstract="true")</annox:annotate> + </xs:appinfo> + </xs:annotation> + <xs:sequence> + <xs:element name="vnf-id" type="xs:string"> + <xs:annotation> + <xs:appinfo> + <annox:annotate target="field">@org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.")</annox:annotate> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/aai-service/provider/src/test/java/org/openecomp/sdnc/sli/aai/r1607/R1607AutoGeneratedTest.java b/aai-service/provider/src/test/java/org/openecomp/sdnc/sli/aai/r1607/R1607AutoGeneratedTest.java new file mode 100644 index 00000000..15a7647e --- /dev/null +++ b/aai-service/provider/src/test/java/org/openecomp/sdnc/sli/aai/r1607/R1607AutoGeneratedTest.java @@ -0,0 +1,489 @@ +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 ONAP 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.sdnc.sli.aai.r1607; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +import java.io.File; +import java.io.IOException; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import javax.xml.bind.SchemaOutputResolver; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.transform.Result; +import javax.xml.transform.stream.StreamResult; + +import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang.StringUtils; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; +import org.openecomp.aai.inventory.v10.GenericVnf; +import org.openecomp.aai.inventory.v10.InventoryResponseItems; +import org.openecomp.sdnc.sli.aai.AAIClient; +import org.openecomp.sdnc.sli.aai.AAIDeclarations; +import org.openecomp.sdnc.sli.aai.AAIRequest; +import org.openecomp.sdnc.sli.aai.AAIService; +import org.openecomp.sdnc.sli.aai.data.AAIDatum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; + + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class R1607AutoGeneratedTest { + + private static final Logger LOG = LoggerFactory.getLogger(R1607AutoGeneratedTest.class); + + protected static AAIClient client; + + protected Map<String, String> cache = new HashMap<String, String>(); + + @BeforeClass + public static void setUp() throws Exception { +// super.setUp(); + URL url = AAIService.class.getResource(AAIService.AAICLIENT_PROPERTIES); + client = new AAIService(url); + LOG.info("\nTaicAAIResourceTest.setUp\n"); + } + + @AfterClass + public static void tearDown() throws Exception { +// super.tearDown(); + client = null; + LOG.info("----------------------- AAIResourceTest.tearDown -----------------------"); + } + + +// @Test + public void test01AutoGeneratedRequest() { + + String[] requestDefinition = { + "query|generic-vnf|generic-vnf.vnf-id:assign:value:bnfm0001v-1147" + }; + + for(String line : requestDefinition){ + // parse request line resource | key structure + String[] segments = line.split("\\|"); + String action = segments[0]; + String resource = segments[1]; + String[] tmpKeys = segments[2].split("&"); + + + String localId = null; + + List<String> keys = new ArrayList<String>(); + String keyLine = null; + + for(String instruction : tmpKeys) { + String[] parts = instruction.split(":"); + String identifier = parts[0]; + String method = parts[2]; + + if(identifier.startsWith(resource)) { + localId = identifier; + } else if(identifier.startsWith("l-interface") && "l2-bridge-bgf".equals(resource)) { + localId = identifier; + } else if(identifier.startsWith("l-interface") && "l2-bridge-sbg".equals(resource)) { + localId = identifier; + } + + switch(parts[1]) { + case "assign": + String postProcesss = parts[3]; + keyLine = processAssign(identifier, method, postProcesss); + if(keyLine != null && !keyLine.trim().isEmpty()) { + keys.add(keyLine); + } + break; + case "cached": + keyLine = processCached(identifier, method); + if(keyLine != null && !keyLine.trim().isEmpty()) { + keys.add(keyLine); + } + break; + } + + } + + switch(action){ + case "save": + List<String> x = Arrays.asList(localId.split("\\.")); + + testAutoGeneratedSaveRequest(resource, keys, x.get(x.size() - 1), cache.get(localId)); + break; + case "query": + test03AutoGeneratedQueryRequest(resource, keys); + break; + case "delete": + test03AutoGeneratedDeleteRequest(resource, keys); + break; + } + } + + LOG.info("done"); + } + + + public void testAutoGeneratedSaveRequest(String resource, List<String> requestKeys, String identifier, String idValue) { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + + try + { + Map<String, String> nameValues = keyToHashMap(StringUtils.join(requestKeys, " AND "), new SvcLogicContext()); + AAIRequest request = AAIRequest.createRequest(resource, nameValues); + Class<AAIDatum> resourceClass = (Class<AAIDatum>) (request==null ? GenericVnf.class : request.getModelClass()); + + Map<String, String> data = new HashMap<String, String>(); + + for(Field field : resourceClass.getDeclaredFields()) { + String type = field.getType().getName(); + if(type.startsWith("java.lang.")){ + Annotation[] fieldAnnotations = field.getAnnotations(); + for(int i = 0; i < fieldAnnotations.length; i++) { + Annotation a = fieldAnnotations[i]; + if(a instanceof JsonProperty){ + JsonProperty pa = (JsonProperty)a; + String name = pa.value(); + String value; + switch(type) { + case "java.lang.Integer": + case "java.lang.Long": + value = RandomStringUtils.random(6, false, true); + break; + case "java.lang.Boolean": + value = "false"; + break; + default: + if(name.equals(identifier)) { + value = idValue; + } else { + value = RandomStringUtils.random(10, true, false); + } + } + data.put(name, value); + } else + if(a instanceof javax.xml.bind.annotation.XmlElement) { + XmlElement xe = (XmlElement)a; + String name = xe.name(); + if("link-type".equals(name)){ + data.put(name, "roadmTail"); + continue; + } + if("operational-status".equals(name)){ + data.put(name, "available"); + continue; + } + String value; + switch(type) { + case "java.lang.Integer": + case "java.lang.Long": + value = RandomStringUtils.random(6, false, true); + break; + case "java.lang.Boolean": + value = "false"; + break; + default: + if(name.equals(identifier)) { + value = idValue; + } else { + value = RandomStringUtils.random(10, true, false); + } + } + data.put(name, value); + } + } + } + } + + SvcLogicContext ctx = new SvcLogicContext(); + + data.remove("resource-version"); + + QueryStatus resp = null; + + //(String resource, boolean force, boolean localOnly, String key, Map<String, String> parms, String prefix, SvcLogicContext ctx) + resp = client.save(resource, false, false, StringUtils.join(requestKeys, " AND "), data, "aaidata", ctx); + } + catch (Throwable e) + { + LOG.error("Caught exception", e); + fail("Caught exception"); + } + } + + public void test03AutoGeneratedQueryRequest(String resource, List<String> requestKeys) { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + + SvcLogicContext ctx = new SvcLogicContext(); + try + { + + QueryStatus response = null; + + response = client.query(resource, false, null, StringUtils.join(requestKeys, " AND "), "aaiTest", null, ctx); + } + catch (Throwable e) + { + LOG.error("Caught exception", e); + fail("Caught exception"); + } + } + + + public void test03AutoGeneratedDeleteRequest(String resource, List<String> requestKeys) { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + + try + { + SvcLogicContext ctx = new SvcLogicContext(); + + QueryStatus response = null; + + response = client.delete(resource, StringUtils.join(requestKeys, " AND "), ctx); + } + catch (Throwable e) + { + LOG.error("Caught exception", e); + fail("Caught exception"); + } + } + + static ArrayList<Method> findSetters(Class<?> c) { + ArrayList<Method> list = new ArrayList<Method>(); + Method[] methods = c.getDeclaredMethods(); + for (Method method : methods) + if (isGetter(method)) + list.add(method); + return list; + } + + + public static boolean isGetter(Method method) { + if (Modifier.isPublic(method.getModifiers()) && + method.getParameterTypes().length == 0) { + if (method.getName().matches("^get[A-Z].*") && + !method.getReturnType().equals(void.class)) + return true; + if (method.getName().matches("^is[A-Z].*") && + method.getReturnType().equals(boolean.class)) + return true; + } + return false; + } + + public static boolean isSetter(Method method) { + return Modifier.isPublic(method.getModifiers()) && + method.getReturnType().equals(void.class) && + method.getParameterTypes().length == 1 && + method.getName().matches("^set[A-Z].*"); + } + + private String processAssign(String identifier, String method, String postProcess) { + String value = null; + if("uuid".equals(method)) { + value = UUID.randomUUID().toString(); + } + + if("cache".equals(postProcess)) { + cache.put(identifier, value); + } + + if("value".equals(method)) { + cache.put(identifier, postProcess); + value = postProcess; + } + + String key = String.format("%s = '%s'", identifier, value); + return key; + } + + private String processCached(String identifier, String method) { + String value = cache.get(identifier); + + String key = String.format("%s = '%s'", identifier, value); + return key; + } + + protected HashMap<String,String> keyToHashMap(String key, SvcLogicContext ctx) { + if (key == null) { + return (null); + } + + LOG.debug("Converting key [" + key + "] to where clause"); + + if (key.startsWith("'") && key.endsWith("'")) { + key = key.substring(1, key.length() - 1); + + LOG.debug("Stripped outer single quotes - key is now [" + key + "]"); + } + + String[] keyTerms = key.split("\\s+"); + + StringBuffer whereBuff = new StringBuffer(); + String term1 = null; + String op = null; + String term2 = null; + HashMap<String, String> results = new HashMap<String, String>(); + + for (int i = 0; i < keyTerms.length; i++) { + if (term1 == null) { + if ("and".equalsIgnoreCase(keyTerms[i]) + || "or".equalsIgnoreCase(keyTerms[i])) { + // Skip over ADD/OR + } else { + term1 = resolveTerm(keyTerms[i], ctx); + } + } else if (op == null) { + if ("==".equals(keyTerms[i])) { + op = "="; + } else { + op = keyTerms[i]; + } + } else { + term2 = resolveTerm(keyTerms[i], ctx); + term2 = term2.trim().replace("'", "").replace("$", "").replace("'", ""); + results.put(term1, term2); + + term1 = null; + op = null; + term2 = null; + } + } + + return (results); + } + + private String resolveTerm(String term, SvcLogicContext ctx) { + if (term == null) { + return (null); + } + + LOG.debug("resolveTerm: term is " + term); + + if (term.startsWith("$") && (ctx != null)) { + // Resolve any index variables. + + return ("'" + resolveCtxVariable(term.substring(1), ctx) + "'"); + } else if (term.startsWith("'") || term.startsWith("\"")) { + return (term); + } else { + return (term.replaceAll("-", "_")); + + } + + } + + private String resolveCtxVariable(String ctxVarName, SvcLogicContext ctx) { + + if (ctxVarName.indexOf('[') == -1) { + // Ctx variable contains no arrays + return (ctx.getAttribute(ctxVarName)); + } + + // Resolve any array references + StringBuffer sbuff = new StringBuffer(); + String[] ctxVarParts = ctxVarName.split("\\["); + sbuff.append(ctxVarParts[0]); + for (int i = 1; i < ctxVarParts.length; i++) { + if (ctxVarParts[i].startsWith("$")) { + int endBracketLoc = ctxVarParts[i].indexOf("]"); + if (endBracketLoc == -1) { + // Missing end bracket ... give up parsing + LOG.warn("Variable reference " + ctxVarName + + " seems to be missing a ']'"); + return (ctx.getAttribute(ctxVarName)); + } + + String idxVarName = ctxVarParts[i].substring(1, endBracketLoc); + String remainder = ctxVarParts[i].substring(endBracketLoc); + + sbuff.append("["); + sbuff.append(ctx.getAttribute(idxVarName)); + sbuff.append(remainder); + + } else { + // Index is not a variable reference + sbuff.append("["); + sbuff.append(ctxVarParts[i]); + } + } + + return (ctx.getAttribute(sbuff.toString())); + } + +// @Test + public void test04VceDataPost() { + LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); + + try + { + URL resource = this.getClass().getResource("/json/tails4.json"); + + LOG.info("Resource is " + resource.getFile()); + File requestFile = new File(resource.getFile()); + if(!requestFile.exists()) { + fail("Test file does not exist"); + } + SvcLogicContext ctx = new SvcLogicContext(); + ObjectMapper mapper = AAIService.getObjectMapper(); + InventoryResponseItems request = mapper.readValue(requestFile, InventoryResponseItems.class); + Map<String, Object> subnetsList = mapper.convertValue(request, Map.class); + AAIDeclarations.class.cast(client).writeMap(subnetsList, "aaiTmp", ctx); + assertNotNull(request); + + } + catch (Exception e) + { + LOG.error("Caught exception", e); + fail("Caught exception"); + } + } + +static class MySchemaOutputResolver extends SchemaOutputResolver { + + public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException { + File file = new File(suggestedFileName); + StreamResult result = new StreamResult(file); + result.setSystemId(file.getAbsolutePath()); + return result; + } + + } +} diff --git a/aai-service/provider/src/test/resources/aaiclient.properties b/aai-service/provider/src/test/resources/aaiclient.properties new file mode 100644 index 00000000..260b5162 --- /dev/null +++ b/aai-service/provider/src/test/resources/aaiclient.properties @@ -0,0 +1,237 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 ONAP 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========================================================= +### + +# +# Configuration file for A&AI Client +# + +# +# Certificate keystore and truststore +# +org.openecomp.sdnc.sli.aai.ssl.trust=/opt/bvc/tls-client/truststore.client.jks +org.openecomp.sdnc.sli.aai.ssl.trust.psswd={truststore-password} +org.openecomp.sdnc.sli.aai.ssl.key=/opt/bvc/tls-client/keystore.client.jks +org.openecomp.sdnc.sli.aai.ssl.key.psswd={keystore-password} +org.openecomp.sdnc.sli.aai.host.certificate.ignore=true + +org.openecomp.sdnc.sli.aai.client.name=SDNC +org.openecomp.sdnc.sli.aai.client.psswd=SDNC + +org.openecomp.sdnc.sli.aai.application=openECOMP + +# +# Configuration file for A&AI Client +# +org.openecomp.sdnc.sli.aai.uri=https://localhost:8443 + + +# query +org.openecomp.sdnc.sli.aai.path.query=/aai/v10/search/sdn-zone-query +org.openecomp.sdnc.sli.aai.query.nodes=/aai/v10/search/nodes-query?search-node-type={node-type}&filter={entity-identifier}:EQUALS:{entity-name} +org.openecomp.sdnc.sli.aai.query.generic=/aai/v10/search/generic-query?key={identifier}:{value}&start-node-type={start-node-type}&include=complex&depth=3 + +# named query +org.openecomp.sdnc.sli.aai.query.named=/aai/search/named-query + + +#update +org.openecomp.sdnc.sli.aai.update=/aai/v10/actions/update + +# vce +org.openecomp.sdnc.sli.aai.path.vce =/aai/v10/network/vces/vce/ +org.openecomp.sdnc.sli.aai.path.vces=/aai/v10/network/vces/ + +# customer +org.openecomp.sdnc.sli.aai.path.customer=/aai/v10/business/customers/customer/{customer-id} + +# service subscription +org.openecomp.sdnc.sli.aai.path.service.subscription=/aai/v10/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type} + +# service instance +org.openecomp.sdnc.sli.aai.path.svcinst=/aai/v10/business/customers/customer/{customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances +org.openecomp.sdnc.sli.aai.path.svcinst.query=/aai/v10/search/generic-query?key=service-instance.service-instance-id:{svc-instance-id}&start-node-type=service-instance&include=service-instance +org.openecomp.sdnc.sli.aai.path.service.instance=/aai/v10/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id} + +# tenant +org.openecomp.sdnc.sli.aai.path.tenant=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id} +org.openecomp.sdnc.sli.aai.path.tenant.query=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant?tenant-name={tenant-name} + +# vservers +org.openecomp.sdnc.sli.aai.path.vservers=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/ +org.openecomp.sdnc.sli.aai.path.vserver=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/tenants/tenant/{tenant-id}/vservers/vserver/{vserver-id} + +# vpls-pe +org.openecomp.sdnc.sli.aai.path.vpls.pes=/aai/v10/network/vpls-pes/ +org.openecomp.sdnc.sli.aai.path.vpls.pe =/aai/v10/network/vpls-pes/vpls-pe/ + +# ctag-pool +org.openecomp.sdnc.sli.aai.path.ctag.pools=/aai/v10/cloud-infrastructure/complexes/complex/{physical-location-id}/ctag-pools +org.openecomp.sdnc.sli.aai.path.ctag.pool=/aai/v10/cloud-infrastructure/complexes/complex/{physical-location-id}/ctag-pools/ctag-pool/{target-pe}/{availability-zone-name} + +# +#-------------- 1510 ---------------------- +# + +# pservers +org.openecomp.sdnc.sli.aai.path.pservers=/aai/v10/cloud-infrastructure/pservers +org.openecomp.sdnc.sli.aai.path.pserver=/aai/v10/cloud-infrastructure/pservers/pserver/{hostname} + +# generic-vnf +#org.openecomp.sdnc.sli.aai.path.generic.vnfs=/aai/v10/network/generic-vnfs +#org.openecomp.sdnc.sli.aai.path.generic.vnf=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id} + +# dvs-switch +org.openecomp.sdnc.sli.aai.path.dvsswitches=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/dvs-switches +org.openecomp.sdnc.sli.aai.path.dvsswitch=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/dvs-switches/dvs-switch/{switch-name} + +# L3 Networks +org.openecomp.sdnc.sli.aai.path.l3networks=/aai/v10/network/l3-networks +org.openecomp.sdnc.sli.aai.path.l3network=/aai/v10/network/l3-networks/l3-network/{network-id} +org.openecomp.sdnc.sli.aai.path.l3network.query.name=/aai/v10/network/l3-networks/l3-network?network-name={network-name} + +# P-Interfaces +org.openecomp.sdnc.sli.aai.path.pserver.pinterfaces=/aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces +org.openecomp.sdnc.sli.aai.path.pserver.pinterface=/aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name} + +# Physical Link +org.openecomp.sdnc.sli.aai.path.physical.links=/aai/v10/network/physical-links +org.openecomp.sdnc.sli.aai.path.physical.link=/aai/v10/network/physical-links/physical-link/{link-name} + +# VPN Bindings +org.openecomp.sdnc.sli.aai.path.vpn.bindings=/aai/v10/network/vpn-bindings/ +org.openecomp.sdnc.sli.aai.path.vpn.binding=/aai/v10/network/vpn-bindings/vpn-binding/{vpn-id} + +# VNF IMAGES +org.openecomp.sdnc.sli.aai.path.vnf.images=/aai/v10/service-design-and-creation/vnf-images +org.openecomp.sdnc.sli.aai.path.vnf.image=/aai/v10/service-design-and-creation/vnf-images/vnf-image/{att-uuid} +org.openecomp.sdnc.sli.aai.path.vnf.image.query=/aai/v10/service-design-and-creation/vnf-images/vnf-image?application={application_model}&application-vendor={application_vendor} + +# UBB Notify +org.openecomp.sdnc.sli.aai.path.notify=/aai/v10/actions/notify +org.openecomp.sdnc.sli.aai.notify.selflink.fqdn=https://sdncodl.it.us.aic.cip.att.com:8443/restconf/config/L3SDN-API:services/layer3-service-list/{service-instance-id} +org.openecomp.sdnc.sli.aai.notify.selflink.avpn=https://sdncodl-conexus.it.us.02.aic.cip.att.com:8543/restconf/config/L3AVPN-EVC-API:services/service-list/{service-instance-id}/service-data/avpn-logicalchannel-information + +# Service +org.openecomp.sdnc.sli.aai.path.service=/aai/v10/service-design-and-creation/services/service/{service-id} +org.openecomp.sdnc.sli.aai.path.services=/aai/v10/service-design-and-creation/services + + +# +#-------------- 1604 ---------------------- +# + +# VNFC +org.openecomp.sdnc.sli.aai.path.vnfc=/aai/v10/network/vnfcs/vnfc/{vnfc-name} + +# site-pair +org.openecomp.sdnc.sli.aai.path.site.pair=/aai/v10/network/site-pair-sets/site-pair-set/{site-pair-set-id}/routing-instances/routing-instance/{routing-instance-id}/site-pairs/site-pair/{site-pair-id} + +# routing-instance +org.openecomp.sdnc.sli.aai.path.routing.instance=/aai/v10/network/site-pair-sets/site-pair-set/{site-pair-set-id}/routing-instances/routing-instance/{routing-instance-id} + +# site-pair-set +org.openecomp.sdnc.sli.aai.path.site.pair.set=/aai/v10/network/site-pair-sets/site-pair-set/{site-pair-set-id} + +# license key resource +org.openecomp.sdnc.sli.aai.path.license.acquire=/aai/v10/actions/assignment/license-management/assignment-group-uuid/{assignment-group-uuid} +org.openecomp.sdnc.sli.aai.path.license=/aai/v10/license-management/license-key-resources/license-key-resource/{att-uuid} + +# logical-link +org.openecomp.sdnc.sli.aai.path.logical.link =/aai/v10/network/logical-links/logical-link/{link-name} + +# virtual-data-center +org.openecomp.sdnc.sli.aai.path.virtual.data.center=/aai/v10/cloud-infrastructure/virtual-data-centers/virtual-data-center/{vdc-id} + +# wan-connector +org.openecomp.sdnc.sli.aai.path.wan.connector=/aai/v10/business/connectors/connector/{resource-instance-id} + +# l-interface +org.openecomp.sdnc.sli.aai.path.lag.interface.l.interface=/aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/lag-interfaces/lag-interface/{lag-interface.interface-name}/l-interfaces/l-interface/{interface-name} +org.openecomp.sdnc.sli.aai.path.p.interface.l.interface=/aai/v10/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{p-interface.interface-name}/l-interfaces/l-interface/{interface-name} + +# l-interface pnf +org.openecomp.sdnc.sli.aai.path.lag.interface.l.interface.pnf=/aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{lag-interface.interface-name}/l-interfaces/l-interface/{interface-name} +org.openecomp.sdnc.sli.aai.path.p.interface.l.interface.pnf=/aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{p-interface.interface-name}/l-interfaces/l-interface/{interface-name} + +# subinterface +org.openecomp.sdnc.sli.aai.path.pnf.lag.interface.subinterface=/aai/v10/network/pnfs/pnf/{pnf-name}/lag-interfaces/lag-interface/{lag-interface.interface-name}/l-interfaces/l-interface/{interface-name} +org.openecomp.sdnc.sli.aai.path.pnf.p.interface.l.interface=/aai/v10/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{p-interface.interface-name}/l-interfaces/l-interface/{interface-name} + +# l3-interface-ipv4-address-list +org.openecomp.sdnc.sli.aai.path.l3.interface.ipv4.address.list=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} +org.openecomp.sdnc.sli.aai.path.vlan.l3.interface.ipv4.address.list=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + +# l3-interface-ipv6-address-list +org.openecomp.sdnc.sli.aai.path.l3.interface.ipv6.address.list=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} +org.openecomp.sdnc.sli.aai.path.vlan.l3.interface.ipv6.address.list=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + +# ipsec-configuration +org.openecomp.sdnc.sli.aai.path.ipsec.configuration=/aai/v10/network/ipsec-configurations/ipsec-configuration/{ipsec-configuration-id} + +# vig server +org.openecomp.sdnc.sli.aai.path.vig.server=/aai/v10/network/ipsec-configurations/ipsec-configuration/{ipsec-configuration-id}/vig-servers/vig-server/{vig-address-type} + +# l3-network +org.openecomp.sdnc.sli.aai.path.l3.network=/aai/v10/network/l3-networks/l3-network/{network-id} + +# subnet +org.openecomp.sdnc.sli.aai.path.subnet=/aai/v10/network/l3-networks/l3-network/{network-id}/subnets/subnet/{subnet-id} + +# multicast-configuration +org.openecomp.sdnc.sli.aai.path.multicast.configuration=/aai/v10/network/multicast-configurations/multicast-configuration/{multicast-configuration-id} + +# org.openecomp.sdnc.sli.aai.path.l.interface.ipv4.address.list +org.openecomp.sdnc.sli.aai.path.l3-interface.ipv4.address.list=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + +# org.openecomp.sdnc.sli.aai.path.l.interface.vlan.ipv4.address.list +org.openecomp.sdnc.sli.aai.path.l3-interface.vlan.ipv4.address.list=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/vlans/vlan/{vlan-interface}/l3-interface-ipv4-address-list/{l3-interface-ipv4-address} + +# org.openecomp.sdnc.sli.aai.path.l.interface.ipv6.address.list +org.openecomp.sdnc.sli.aai.path.l3-interface.ipv6.address.list=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/l-interfaces/l-interface/{interface-name}/l3-interface-ipv6-address-list/{l3-interface-ipv6-address} + +# volume.group +org.openecomp.sdnc.sli.aai.path.volume.group=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/volume-groups/volume-group/{volume-group-id} + +#cloud region +org.openecomp.sdnc.sli.aai.path.cloud.region=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id} + +# vf-module +org.openecomp.sdnc.sli.aai.path.vf.module=/aai/v10/network/generic-vnfs/generic-vnf/{vnf-id}/vf-modules/vf-module/{vf-module-id} + +# network-policy +org.openecomp.sdnc.sli.aai.path.network.policy=/aai/v10/network/network-policies/network-policy/{network-policy-id} + +# pnf +org.openecomp.sdnc.sli.aai.path.pnf=/aai/v10/network/pnfs/pnf/{pnf-name} + +# oam-network +org.openecomp.sdnc.sli.aai.path.oam.network=/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/{cloud-owner}/{cloud-region-id}/oam-networks/oam-network/{network-uuid} + +# route-table-reference +org.openecomp.sdnc.sli.aai.path.route.table.reference=/aai/v10/network/route-table-references/route-table-reference/{route-table-reference-id} + +# +# Formatting +# +org.openecomp.sdnc.sli.aai.param.format=filter=%s:%s +org.openecomp.sdnc.sli.aai.param.vnf_type=vnf-type +org.openecomp.sdnc.sli.aai.param.physical.location.id=physical-location-id +org.openecomp.sdnc.sli.aai.param.service.type=service-type |