diff options
author | Geora Barsky <georab@amdocs.com> | 2018-10-26 12:53:09 -0400 |
---|---|---|
committer | Geora Barsky <georab@amdocs.com> | 2018-11-01 12:36:15 -0400 |
commit | 28d58cedeba041e536d71f82325cb1d32eeba730 (patch) | |
tree | 1b3cc54c3c3d609c7dcbd469ea422d15ec022b94 | |
parent | 49cc90f205535596dfdad0cf81a5bbf6ad93f5f8 (diff) |
Enhance model to support L2 Fabric
Adding JUnit tests and swagger specs
Issue-ID: LOG-780
Change-Id: Iaf7cb19a6310ebdeef085a94f00623041aa4f89b
Signed-off-by: Geora Barsky <georab@amdocs.com>
36 files changed, 3554 insertions, 357 deletions
@@ -18,6 +18,7 @@ <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <swagger.directory>${project.build.directory}/generated-resources/swagger</swagger.directory>
</properties>
<dependencies>
@@ -33,6 +34,29 @@ <version>4.12</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-core</artifactId>
+ <version>1.5.9</version>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ <version>1.5.9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>2.24</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-common</artifactId>
+ <version>2.24</version>
+ </dependency>
+
</dependencies>
<build>
@@ -42,6 +66,38 @@ <artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
</plugin>
+ <plugin>
+ <groupId>com.github.kongchen</groupId>
+ <artifactId>swagger-maven-plugin</artifactId>
+ <version>3.1.3</version>
+ <configuration>
+ <apiSources>
+ <apiSource>
+ <locations>org.onap.pomba.common.resource.AuditResource</locations>
+ <schemes>http</schemes>
+ <host>host:port</host>
+ <basePath>/XXXcontextbuilder</basePath>
+ <info>
+ <title>Swagger Specification for POMBA Common Model</title>
+ <version>${project.version}</version>
+ <description>POMBA Audit Context Builder API</description>
+ </info>
+ <templatePath>${basedir}/src/main/resources/strapdown.html.hbs</templatePath>
+ <outputPath>${basedir}/src/main/resources/commonModel.html</outputPath>
+ <swaggerDirectory>${swagger.directory}</swaggerDirectory>
+ </apiSource>
+ </apiSources>
+ </configuration>
+ <executions>
+ <execution>
+ <!-- <phase>compile</phase> -->
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
diff --git a/src/main/java/org/onap/pomba/common/datatypes/Attribute.java b/src/main/java/org/onap/pomba/common/datatypes/Attribute.java index 1bf32bc..c940322 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/Attribute.java +++ b/src/main/java/org/onap/pomba/common/datatypes/Attribute.java @@ -20,6 +20,7 @@ package org.onap.pomba.common.datatypes; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModelProperty;
public class Attribute {
@Expose
@@ -33,7 +34,7 @@ public class Attribute { private DataQuality dataQuality = DataQuality.ok();
public enum Name {
- adminState,
+ adminStatus,
ipAddress,
hostName,
lockedBoolean,
@@ -44,20 +45,49 @@ public class Attribute { sharedNetworkBoolean,
networkRole,
routerExternalBoolean,
- imageId
+ imageId,
+ nfNamingCode,
+ nfType,
+ nfRole,
+ nfFunction,
+ nfcNamingCode,
+ nfcNamingTypen,
+ name2,
+ equipType,
+ equipVendor,
+ equipModel,
+ swVesrion,
+ serialNumber,
+ provStatus,
+ fqdn,
+ interfaceRole,
+ interfaceType,
+ speedValue,
+ speedUnits,
+ portDescription,
+ circuitId,
+ linkType,
+ routingProtocol,
+ networkName,
+ isPortMirrored
}
+ @ApiModelProperty(value = "Name of the attribute")
public Name getName() {
return name;
}
public void setName(Name name) {
this.name = name;
}
+
+ @ApiModelProperty(value = "Value of the attribute")
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
+
+ @ApiModelProperty(value = "Data Quality indicator of the attribute")
public DataQuality getDataQuality() {
return dataQuality;
}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/LInterface.java b/src/main/java/org/onap/pomba/common/datatypes/LInterface.java new file mode 100644 index 0000000..1eaf12d --- /dev/null +++ b/src/main/java/org/onap/pomba/common/datatypes/LInterface.java @@ -0,0 +1,82 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; + +public class LInterface { + + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + @Expose + @SerializedName("port") + private Port port = new Port(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + + public Port getPort() { + return port; + } + + public void setPort(Port port) { + this.port = port; + } + + +} + diff --git a/src/main/java/org/onap/pomba/common/datatypes/LogicalLink.java b/src/main/java/org/onap/pomba/common/datatypes/LogicalLink.java new file mode 100644 index 0000000..7b1de66 --- /dev/null +++ b/src/main/java/org/onap/pomba/common/datatypes/LogicalLink.java @@ -0,0 +1,88 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; + +public class LogicalLink { + + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("modelVersionID") + private String modelVersionID; + @Expose + @SerializedName("modelInvariantUUID") + private String modelInvariantUUID; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + public String getModelVersionID() { + return modelVersionID; + } + public void setModelVersionID(String modelVersionID) { + this.modelVersionID = modelVersionID; + } + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + +}
\ No newline at end of file diff --git a/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java b/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java index 1fc8118..0564b2f 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java +++ b/src/main/java/org/onap/pomba/common/datatypes/ModelContext.java @@ -20,9 +20,13 @@ package org.onap.pomba.common.datatypes; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
import java.util.ArrayList;
import java.util.List;
+@ApiModel(value="ModelContext")
public class ModelContext {
@Expose
@@ -35,21 +39,30 @@ public class ModelContext { @SerializedName("attributeList")
private List<Attribute> attributeList = new ArrayList<>();
@Expose
- @SerializedName("vfList")
- private List<VF> vfList = new ArrayList<>();
+ @SerializedName("vnfList")
+ private List<VNF> vnfList = new ArrayList<>();
+ @Expose
+ @SerializedName("pnfList")
+ private List<PNF> pnfList = new ArrayList<>();
+ @Expose
+ @SerializedName("networkList")
+ private List<Network> networkList = new ArrayList<>();
+ @ApiModelProperty(value = "Service object of the model")
public Service getService() {
return service;
}
public void setService(Service service) {
this.service = service;
}
+ @ApiModelProperty(value = "Data Quality indicator")
public DataQuality getDataQuality() {
return dataQuality;
}
public void setDataQuality(DataQuality dataQuality) {
this.dataQuality = dataQuality;
}
+ @ApiModelProperty(value = "List of attributes")
public List<Attribute> getAttributes() {
return attributeList;
}
@@ -59,13 +72,31 @@ public class ModelContext { public void addAttribute(Attribute attribute) {
this.attributeList.add(attribute);
}
- public List<VF> getVfs() {
- return vfList;
+ @ApiModelProperty(value = "List of VNF associated with the service instance")
+ public List<VNF> getVnfs() {
+ return vnfList;
+ }
+ public void setVnfs(List<VNF> vfList) {
+ this.vnfList = vfList;
}
- public void setVfs(List<VF> vfList) {
- this.vfList = vfList;
+ public void addVf(VNF vf) {
+ this.vnfList.add(vf);
}
- public void addVf(VF vf) {
- this.vfList.add(vf);
+ @ApiModelProperty(value = "List of PNF associated with the service instance")
+ public List<PNF> getPnfs() {
+ return pnfList;
}
+ public void setPnfs(List<PNF> pnfList) {
+ this.pnfList = pnfList;
+ }
+ public void addPnf(PNF pnf) {
+ this.pnfList.add(pnf);
+ }
+ @ApiModelProperty(value = "List of networks associated with the service instance")
+ public List<Network> getNetworkList() { return networkList; }
+ public void setNetworkList(List<Network> networkList) { this.networkList = networkList; }
+ public void addNetwork(Network network) {
+ this.networkList.add(network);
+ }
+
}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/Network.java b/src/main/java/org/onap/pomba/common/datatypes/Network.java index 171c6a5..9ba96e1 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/Network.java +++ b/src/main/java/org/onap/pomba/common/datatypes/Network.java @@ -25,23 +25,26 @@ import java.util.List; public class Network {
@Expose
+ @SerializedName("uuid")
+ private String uuid;
+ @Expose
@SerializedName("name")
private String name;
@Expose
- @SerializedName("invariantUUID")
- private String invariantUuid;
- @Expose
- @SerializedName("uuid")
- private String uuid;
+ @SerializedName("modelVersionID")
+ private String modelVersionID;
@Expose
- @SerializedName("type")
- private String type;
+ @SerializedName("modelInvariantUUID")
+ private String modelInvariantUUID;
@Expose
@SerializedName("dataQuality")
private DataQuality dataQuality = DataQuality.ok();
@Expose
@SerializedName("attributeList")
private List<Attribute> attributeList = new ArrayList<>();
+ @Expose
+ @SerializedName("networkPolicyList")
+ private List<NetworkPolicy> networkPolicies = new ArrayList<>();
public String getName() {
return name;
@@ -49,24 +52,12 @@ public class Network { public void setName(String name) {
this.name = name;
}
- public String getInvariantUuid() {
- return invariantUuid;
- }
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
public List<Attribute> getAttributes() {
return attributeList;
}
@@ -82,5 +73,23 @@ public class Network { public void setDataQuality(DataQuality dataQuality) {
this.dataQuality = dataQuality;
}
+ public String getModelVersionID() { return modelVersionID; }
+ public void setModelVersionID(String modelVersionID) { this.modelVersionID = modelVersionID; }
+
+ public List<NetworkPolicy> getNetworkPolicies() {
+ return networkPolicies;
+ }
+
+ public void setNetworkPolicies(List<NetworkPolicy> networkPolicies) {
+ this.networkPolicies = networkPolicies;
+ }
+
+ public String getModelInvariantUUID() {
+ return modelInvariantUUID;
+ }
+
+ public void setModelInvariantUUID(String modelInvariantUUID) {
+ this.modelInvariantUUID = modelInvariantUUID;
+ }
}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/NetworkPolicy.java b/src/main/java/org/onap/pomba/common/datatypes/NetworkPolicy.java new file mode 100644 index 0000000..348642d --- /dev/null +++ b/src/main/java/org/onap/pomba/common/datatypes/NetworkPolicy.java @@ -0,0 +1,72 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; + +public class NetworkPolicy { + + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + + + +} + diff --git a/src/main/java/org/onap/pomba/common/datatypes/PInterface.java b/src/main/java/org/onap/pomba/common/datatypes/PInterface.java new file mode 100644 index 0000000..8b55aa5 --- /dev/null +++ b/src/main/java/org/onap/pomba/common/datatypes/PInterface.java @@ -0,0 +1,92 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; + +public class PInterface { + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + @Expose + @SerializedName("physicalLinkList") + private List<PhysicalLink> physicalLinkList = new ArrayList<>(); + @Expose + @SerializedName("port") + private Port port; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + + public List<PhysicalLink> getPhysicalLinkList() { + return physicalLinkList; + } + + public void setPhysicalLinkList(List<PhysicalLink> physicalLinkList) { + this.physicalLinkList = physicalLinkList; + } + + public Port getPort() { + return port; + } + + public void setPort(Port port) { + this.port = port; + } + + + +} diff --git a/src/main/java/org/onap/pomba/common/datatypes/PNF.java b/src/main/java/org/onap/pomba/common/datatypes/PNF.java new file mode 100644 index 0000000..1aa6836 --- /dev/null +++ b/src/main/java/org/onap/pomba/common/datatypes/PNF.java @@ -0,0 +1,83 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import java.util.ArrayList; +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class PNF { + + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("modelVersionID") + private String modelVersionID; + @Expose + @SerializedName("modelInvariantUUID") + private String modelInvariantUUID; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { this.dataQuality = dataQuality; } + public String getModelVersionID() { return modelVersionID; } + public void setModelVersionID(String modelVersionID) { this.modelVersionID = modelVersionID; } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + +} diff --git a/src/main/java/org/onap/pomba/common/datatypes/PhysicalLink.java b/src/main/java/org/onap/pomba/common/datatypes/PhysicalLink.java new file mode 100644 index 0000000..e89a1de --- /dev/null +++ b/src/main/java/org/onap/pomba/common/datatypes/PhysicalLink.java @@ -0,0 +1,72 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; + +public class PhysicalLink { + + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + + + +} + diff --git a/src/main/java/org/onap/pomba/common/datatypes/Port.java b/src/main/java/org/onap/pomba/common/datatypes/Port.java new file mode 100644 index 0000000..bced3b7 --- /dev/null +++ b/src/main/java/org/onap/pomba/common/datatypes/Port.java @@ -0,0 +1,71 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; + +public class Port { + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + + + +} + diff --git a/src/main/java/org/onap/pomba/common/datatypes/Pserver.java b/src/main/java/org/onap/pomba/common/datatypes/Pserver.java new file mode 100644 index 0000000..ad04bad --- /dev/null +++ b/src/main/java/org/onap/pomba/common/datatypes/Pserver.java @@ -0,0 +1,89 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import java.util.ArrayList; +import java.util.List; + +public class Pserver { + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + @Expose + @SerializedName("pInterfaceList") + private List<PInterface> pInterfaceList = new ArrayList<>(); + @Expose + @SerializedName("logicalLinkList") + private List<LogicalLink> logicalLinkList = new ArrayList<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { + this.dataQuality = dataQuality; + } + public List<PInterface> getPInterfaceList() { + return pInterfaceList; + } + public void setPInterfaceList(List<PInterface> pInterfaceList) { + this.pInterfaceList = pInterfaceList; + } + + public List<LogicalLink> getLogicalLinkList() { + return logicalLinkList; + } + + public void setLogicalLinkList(List<LogicalLink> logicalLinkList) { + this.logicalLinkList = logicalLinkList; + } + + +} diff --git a/src/main/java/org/onap/pomba/common/datatypes/Service.java b/src/main/java/org/onap/pomba/common/datatypes/Service.java index 1579434..b18c792 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/Service.java +++ b/src/main/java/org/onap/pomba/common/datatypes/Service.java @@ -26,14 +26,17 @@ import java.util.List; public class Service {
@Expose
+ @SerializedName("uuid")
+ private String uuid;
+ @Expose
@SerializedName("name")
private String name;
@Expose
- @SerializedName("invariantUUID")
- private String invariantUuid;
+ @SerializedName("modelVersionID")
+ private String modelVersionID;
@Expose
- @SerializedName("uuid")
- private String uuid;
+ @SerializedName("modelInvariantUUID")
+ private String modelInvariantUUID;
@Expose
@SerializedName("dataQuality")
private DataQuality dataQuality = DataQuality.ok();
@@ -47,12 +50,6 @@ public class Service { public void setName(String name) {
this.name = name;
}
- public String getInvariantUuid() {
- return invariantUuid;
- }
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
public String getUuid() {
return uuid;
}
@@ -71,7 +68,15 @@ public class Service { public void setAttributes(List<Attribute> attributeList) {
this.attributeList = attributeList;
}
- public void addAttribute(Attribute attribute) {
- this.attributeList.add(attribute);
+ public String getModelVersionID() { return modelVersionID; }
+ public void setModelVersionID(String modelVersionID) { this.modelVersionID = modelVersionID; }
+
+ public String getModelInvariantUUID() {
+ return modelInvariantUUID;
}
+
+ public void setModelInvariantUUID(String modelInvariantUUID) {
+ this.modelInvariantUUID = modelInvariantUUID;
+ }
+
}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/VFModule.java b/src/main/java/org/onap/pomba/common/datatypes/VFModule.java index 9d19dc0..3ea8ede 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/VFModule.java +++ b/src/main/java/org/onap/pomba/common/datatypes/VFModule.java @@ -26,14 +26,20 @@ import java.util.List; public class VFModule {
@Expose
+ @SerializedName("uuid")
+ private String uuid;
+ @Expose
@SerializedName("name")
private String name;
@Expose
- @SerializedName("invariantUUID")
- private String invariantUuid;
+ @SerializedName("modelVersionID")
+ private String modelVersionID;
@Expose
- @SerializedName("uuid")
- private String uuid;
+ @SerializedName("modelInvariantUUID")
+ private String modelInvariantUUID;
+ @Expose
+ @SerializedName("modelCustomizationUUID")
+ private String modelCustomizationUUID;
@Expose
@SerializedName("maxInstances")
private int maxInstances;
@@ -60,12 +66,6 @@ public class VFModule { public void setName(String name) {
this.name = name;
}
- public String getInvariantUuid() {
- return invariantUuid;
- }
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
public String getUuid() {
return uuid;
}
@@ -117,4 +117,18 @@ public class VFModule { public void setDataQuality(DataQuality dataQuality) {
this.dataQuality = dataQuality;
}
+ public String getModelVersionID() { return modelVersionID; }
+ public void setModelVersionID(String modelVersionID) { this.modelVersionID = modelVersionID; }
+ public String getModelCustomizationUUID() { return modelCustomizationUUID; }
+ public void setModelCustomizationUUID(String modelCustomizationUUID) { this.modelCustomizationUUID = modelCustomizationUUID; }
+
+ public String getModelInvariantUUID() {
+ return modelInvariantUUID;
+ }
+
+ public void setModelInvariantUUID(String modelInvariantUUID) {
+ this.modelInvariantUUID = modelInvariantUUID;
+ }
+
+
}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/VM.java b/src/main/java/org/onap/pomba/common/datatypes/VM.java index 0b4be65..1371e07 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/VM.java +++ b/src/main/java/org/onap/pomba/common/datatypes/VM.java @@ -25,23 +25,23 @@ import java.util.List; public class VM {
@Expose
- @SerializedName("name")
- private String name;
- @Expose
- @SerializedName("invariantUUID")
- private String invariantUuid;
- @Expose
@SerializedName("uuid")
private String uuid;
@Expose
- @SerializedName("nfNamingCode")
- private String nfcNamingCode;
+ @SerializedName("name")
+ private String name;
@Expose
@SerializedName("dataQuality")
private DataQuality dataQuality = DataQuality.ok();
@Expose
@SerializedName("attributeList")
private List<Attribute> attributeList = new ArrayList<>();
+ @Expose
+ @SerializedName("pServer")
+ private Pserver pServer = new Pserver();
+ @Expose
+ @SerializedName("lInterfaceList")
+ private List<LInterface> lInterfaceList = new ArrayList<>();
public String getName() {
return name;
@@ -49,24 +49,12 @@ public class VM { public void setName(String name) {
this.name = name;
}
- public String getInvariantUuid() {
- return invariantUuid;
- }
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
- public String getNfcNamingCode() {
- return nfcNamingCode;
- }
- public void setNfcNamingCode(String nfcType) {
- this.nfcNamingCode = nfcType;
- }
public List<Attribute> getAttributes() {
return attributeList;
}
@@ -83,4 +71,22 @@ public class VM { this.dataQuality = dataQuality;
}
+ public Pserver getPServer() {
+ return pServer;
+ }
+
+ public void setPServer(Pserver pServer) {
+ this.pServer = pServer;
+ }
+
+ public List<LInterface> getLInterfaceList() {
+ return lInterfaceList;
+ }
+
+ public void setLInterfaceList(List<LInterface> lInterfaceList) {
+ this.lInterfaceList = lInterfaceList;
+ }
+
+
+
}
diff --git a/src/main/java/org/onap/pomba/common/datatypes/VF.java b/src/main/java/org/onap/pomba/common/datatypes/VNF.java index ded7ae2..49db2f9 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/VF.java +++ b/src/main/java/org/onap/pomba/common/datatypes/VNF.java @@ -1,111 +1,128 @@ -/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2018 Amdocs
- * ============================================================================
- * 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.onap.pomba.common.datatypes;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.google.gson.annotations.Expose;
-import com.google.gson.annotations.SerializedName;
-
-public class VF {
-
- @Expose
- @SerializedName("name")
- private String name;
- @Expose
- @SerializedName("type")
- private String type;
- @Expose
- @SerializedName("invariantUUID")
- private String invariantUuid;
- @Expose
- @SerializedName("uuid")
- private String uuid;
- @Expose
- @SerializedName("dataQuality")
- private DataQuality dataQuality = DataQuality.ok();
- @Expose
- @SerializedName("attributeList")
- private List<Attribute> attributeList = new ArrayList<>();
- @Expose
- @SerializedName("vfModuleList")
- private List<VFModule> vfModules = new ArrayList<>();
- @Expose
- @SerializedName("vnfcList")
- private List<VNFC> vnfcs = new ArrayList<>();
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
- public String getInvariantUuid() {
- return invariantUuid;
- }
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
- public String getUuid() {
- return uuid;
- }
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
- public List<VFModule> getVfModules() {
- return vfModules;
- }
- public void setVfModules(List<VFModule> vfModules) {
- this.vfModules = vfModules;
- }
- public void addVfModule(VFModule vfModule) {
- this.vfModules.add(vfModule);
- }
- public List<VNFC> getVnfcs() {
- return vnfcs;
- }
- public void setVnfcs(List<VNFC> vnfc) {
- this.vnfcs = vnfc;
- }
- public void addVnfc(VNFC vnfc) {
- this.vnfcs.add(vnfc);
- }
- public List<Attribute> getAttributes() {
- return attributeList;
- }
- public void setAttributes(List<Attribute> attributeList) {
- this.attributeList = attributeList;
- }
- public void addAttribute(Attribute attribute) {
- this.attributeList.add(attribute);
- }
- public DataQuality getDataQuality() {
- return dataQuality;
- }
- public void setDataQuality(DataQuality dataQuality) {
- this.dataQuality = dataQuality;
- }
-}
+/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class VNF { + + @Expose + @SerializedName("uuid") + private String uuid; + @Expose + @SerializedName("name") + private String name; + @Expose + @SerializedName("type") + private String type; + @Expose + @SerializedName("modelVersionID") + private String modelVersionID; + @Expose + @SerializedName("modelInvariantUUID") + private String modelInvariantUUID; + @Expose + @SerializedName("dataQuality") + private DataQuality dataQuality = DataQuality.ok(); + @Expose + @SerializedName("attributeList") + private List<Attribute> attributeList = new ArrayList<>(); + @Expose + @SerializedName("vfModuleList") + private List<VFModule> vfModules = new ArrayList<>(); + @Expose + @SerializedName("vnfcList") + private List<VNFC> vnfcs = new ArrayList<>(); + @Expose + @SerializedName("networkList") + private List<Network> networks = new ArrayList<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + public List<VFModule> getVfModules() { + return vfModules; + } + public void setVfModules(List<VFModule> vfModules) { + this.vfModules = vfModules; + } + public void addVfModule(VFModule vfModule) { + this.vfModules.add(vfModule); + } + public List<VNFC> getVnfcs() { + return vnfcs; + } + public void setVnfcs(List<VNFC> vnfc) { + this.vnfcs = vnfc; + } + public void addVnfc(VNFC vnfc) { + this.vnfcs.add(vnfc); + } + public List<Attribute> getAttributes() { + return attributeList; + } + public void setAttributes(List<Attribute> attributeList) { + this.attributeList = attributeList; + } + public void addAttribute(Attribute attribute) { + this.attributeList.add(attribute); + } + public DataQuality getDataQuality() { + return dataQuality; + } + public void setDataQuality(DataQuality dataQuality) { this.dataQuality = dataQuality; } + public String getModelVersionID() { return modelVersionID; } + public void setModelVersionID(String modelVersionID) { this.modelVersionID = modelVersionID; } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public List<Network> getNetworks() { + return networks; + } + + public void setNetworks(List<Network> networks) { + this.networks = networks; + } + +} diff --git a/src/main/java/org/onap/pomba/common/datatypes/VNFC.java b/src/main/java/org/onap/pomba/common/datatypes/VNFC.java index dd697d8..f05b1cf 100644 --- a/src/main/java/org/onap/pomba/common/datatypes/VNFC.java +++ b/src/main/java/org/onap/pomba/common/datatypes/VNFC.java @@ -26,17 +26,17 @@ import java.util.List; public class VNFC {
@Expose
+ @SerializedName("uuid")
+ private String uuid;
+ @Expose
@SerializedName("name")
private String name;
@Expose
- @SerializedName("invariantUUID")
- private String invariantUuid;
+ @SerializedName("modelVersionID")
+ private String modelVersionID;
@Expose
- @SerializedName("uuid")
- private String uuid;
- @Expose
- @SerializedName("type")
- private String type;
+ @SerializedName("modelInvariantUUID")
+ private String modelInvariantUUID;
@Expose
@SerializedName("dataQuality")
private DataQuality dataQuality = DataQuality.ok();
@@ -50,24 +50,12 @@ public class VNFC { public void setName(String name) {
this.name = name;
}
- public String getInvariantUuid() {
- return invariantUuid;
- }
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
public List<Attribute> getAttributes() {
return attributeList;
}
@@ -83,4 +71,19 @@ public class VNFC { public void setDataQuality(DataQuality dataQuality) {
this.dataQuality = dataQuality;
}
+ public String getModelVersionID() {
+ return modelVersionID;
+ }
+ public void setModelVersionID(String modelVersionID) {
+ this.modelVersionID = modelVersionID;
+ }
+
+ public String getModelInvariantUUID() {
+ return modelInvariantUUID;
+ }
+
+ public void setModelInvariantUUID(String modelInvariantUUID) {
+ this.modelInvariantUUID = modelInvariantUUID;
+ }
+
}
diff --git a/src/main/java/org/onap/pomba/common/resource/AuditResource.java b/src/main/java/org/onap/pomba/common/resource/AuditResource.java new file mode 100644 index 0000000..03058ed --- /dev/null +++ b/src/main/java/org/onap/pomba/common/resource/AuditResource.java @@ -0,0 +1,66 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.resource; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiParam; +import org.onap.pomba.common.datatypes.ModelContext; + +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; + +@Api +@Path("/service") +@Produces({MediaType.APPLICATION_JSON}) +public class AuditResource { + + + @GET + @Path("/context") + @Produces({ MediaType.APPLICATION_JSON }) + @ApiOperation( + value = "Get Common model context from Context Builder", + response = ModelContext.class) + @ApiResponses(value = { + @ApiResponse(code = 404, message = "Service not available"), + @ApiResponse(code = 400, message = "Bad request"), + @ApiResponse(code = 401, message = "Unauthorized"), + @ApiResponse(code = 500, message = "Unexpected Runtime error") }) + + public ModelContext getContext( + @ApiParam(value = "ID that identifies calling application", required = true) @HeaderParam("X-FromAppId") String xFromAppId, + @ApiParam(value = "Transaction ID published by the calling application", required = false) @HeaderParam("X-TransactionId") String xTransactionId, + @ApiParam(value = "Instance ID of the audited service", required = true) @QueryParam("serviceInstanceId") String serviceInstanceId, + @ApiParam(value = "Unique identifier of a SDC model version", required = false) @QueryParam("modelVersionId") String modelVersionId, + @ApiParam(value = "Global identifier of each SDC asset", required = false) @QueryParam("modelInvariantId") String modelInvariantId + ) + + { + return null; + } + + +} diff --git a/src/main/resources/commonModel.html b/src/main/resources/commonModel.html new file mode 100644 index 0000000..3723c3b --- /dev/null +++ b/src/main/resources/commonModel.html @@ -0,0 +1,1741 @@ +<!DOCTYPE html> +<html> +<title>API Document</title> + +<xmp theme="united" style="display:none;"> +#Swagger Specification for POMBA Common Model + + +## HTTP://host:port/XXXcontextbuilder + + +POMBA Audit Context Builder API + + + +**Version** 1.4.0-SNAPSHOT + +[**Terms of Service**]() + + + + + + + + + + + + +# APIs + + +## /service/context + + +### GET + +<a id="getContext">Get Common model context from Context Builder</a> + + + + + + + + + +#### Request + + + +##### Parameters + +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> + + + +<tr> + <th>X-FromAppId</th> + <td>header</td> + <td>yes</td> + <td> + ID that identifies calling application + + </td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>X-TransactionId</th> + <td>header</td> + <td>no</td> + <td> + Transaction ID published by the calling application + + </td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>serviceInstanceId</th> + <td>query</td> + <td>yes</td> + <td> + Instance ID of the audited service + + </td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>modelVersionId</th> + <td>query</td> + <td>no</td> + <td> + Unique identifier of a SDC model version + + </td> + <td> - </td> + + + <td>string </td> + + +</tr> + +<tr> + <th>modelInvariantId</th> + <td>query</td> + <td>no</td> + <td> + Global identifier of each SDC asset + + </td> + <td> - </td> + + + <td>string </td> + + +</tr> + + +</table> + + + +#### Response + +**Content-Type: ** application/json + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +| 200 | successful operation | <a href="#/definitions/ModelContext">ModelContext</a>| +| 400 | Bad request | - | +| 401 | Unauthorized | - | +| 404 | Service not available | - | +| 500 | Unexpected Runtime error | - | + + + + + + + + + + + + + + + + + + + +# Definitions + +## <a name="/definitions/Attribute">Attribute</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>Name of the attribute</td> + <td></td> + </tr> + + <tr> + <td>value</td> + <td> + + + string + + </td> + <td>optional</td> + <td>Value of the attribute</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>Data Quality indicator of the attribute</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/DataQuality">DataQuality</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>status</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>errorText</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/LInterface">LInterface</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>port</td> + <td> + + <a href="#/definitions/Port">Port</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/LogicalLink">LogicalLink</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelVersionID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelInvariantUUID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/ModelContext">ModelContext</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>service</td> + <td> + + <a href="#/definitions/Service">Service</a> + + + </td> + <td>optional</td> + <td>Service object of the model</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>Data Quality indicator</td> + <td></td> + </tr> + + <tr> + <td>networkList</td> + <td> + + + array[<a href="#/definitions/Network">Network</a>] + + + + </td> + <td>optional</td> + <td>List of networks associated with the service instance</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>List of attributes</td> + <td></td> + </tr> + + <tr> + <td>pnfs</td> + <td> + + + array[<a href="#/definitions/PNF">PNF</a>] + + + + </td> + <td>optional</td> + <td>List of PNF associated with the service instance</td> + <td></td> + </tr> + + <tr> + <td>vnfs</td> + <td> + + + array[<a href="#/definitions/VNF">VNF</a>] + + + + </td> + <td>optional</td> + <td>List of VNF associated with the service instance</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/Network">Network</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelVersionID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelInvariantUUID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>networkPolicies</td> + <td> + + + array[<a href="#/definitions/NetworkPolicy">NetworkPolicy</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/NetworkPolicy">NetworkPolicy</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/PInterface">PInterface</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>physicalLinkList</td> + <td> + + + array[<a href="#/definitions/PhysicalLink">PhysicalLink</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>port</td> + <td> + + <a href="#/definitions/Port">Port</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/PNF">PNF</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelVersionID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelInvariantUUID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/PhysicalLink">PhysicalLink</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/Port">Port</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/Pserver">Pserver</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>logicalLinkList</td> + <td> + + + array[<a href="#/definitions/LogicalLink">LogicalLink</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>pinterfaceList</td> + <td> + + + array[<a href="#/definitions/PInterface">PInterface</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/Service">Service</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelVersionID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelInvariantUUID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VFModule">VFModule</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelVersionID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelInvariantUUID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelCustomizationUUID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>maxInstances</td> + <td> + + + integer (int32) + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>minInstances</td> + <td> + + + integer (int32) + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>vms</td> + <td> + + + array[<a href="#/definitions/VM">VM</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>networks</td> + <td> + + + array[<a href="#/definitions/Network">Network</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VM">VM</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>linterfaceList</td> + <td> + + + array[<a href="#/definitions/LInterface">LInterface</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>pserver</td> + <td> + + <a href="#/definitions/Pserver">Pserver</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VNF">VNF</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>type</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelVersionID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelInvariantUUID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>vfModules</td> + <td> + + + array[<a href="#/definitions/VFModule">VFModule</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>vnfcs</td> + <td> + + + array[<a href="#/definitions/VNFC">VNFC</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>networks</td> + <td> + + + array[<a href="#/definitions/Network">Network</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + +## <a name="/definitions/VNFC">VNFC</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + + <tr> + <td>uuid</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>name</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelVersionID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>modelInvariantUUID</td> + <td> + + + string + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>dataQuality</td> + <td> + + <a href="#/definitions/DataQuality">DataQuality</a> + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + + <tr> + <td>attributes</td> + <td> + + + array[<a href="#/definitions/Attribute">Attribute</a>] + + + + </td> + <td>optional</td> + <td>-</td> + <td></td> + </tr> + +</table> + + + +</xmp> + +<script src="http://strapdownjs.com/v/0.2/strapdown.js"></script> +</html>
\ No newline at end of file diff --git a/src/main/resources/markdown.hbs b/src/main/resources/markdown.hbs new file mode 100644 index 0000000..d1375ac --- /dev/null +++ b/src/main/resources/markdown.hbs @@ -0,0 +1,108 @@ +#{{#info}}{{title}} + + +## {{join schemes " | "}}://{{host}}{{basePath}} + + +{{description}} + +{{#contact}} +[**Contact the developer**](mailto:{{email}}) +{{/contact}} + +**Version** {{version}} + +[**Terms of Service**]({{termsOfService}}) + +{{#license}}[**{{name}}**]({{url}}){{/license}} + +{{/info}} + +{{#if consumes}}**Consumes:** {{join consumes ", "}}{{/if}} + +{{#if produces}}**Produces:** {{join produces ", "}}{{/if}} + +{{#if securityDefinitions}} +# Security Definitions +{{/if}} +{{> security}} + +# APIs + +{{#each paths}} +## {{@key}} +{{#this}} +{{#get}} +### GET +{{> operation}} +{{/get}} + +{{#put}} +### PUT +{{> operation}} +{{/put}} + +{{#post}} +### POST + +{{> operation}} + +{{/post}} + +{{#delete}} +### DELETE +{{> operation}} +{{/delete}} + +{{#option}} +### OPTION +{{> operation}} +{{/option}} + +{{#patch}} +### PATCH +{{> operation}} +{{/patch}} + +{{#head}} +### HEAD +{{> operation}} +{{/head}} + +{{/this}} +{{/each}} + +# Definitions +{{#each definitions}} +## <a name="/definitions/{{@key}}">{{@key}}</a> + +<table border="1"> + <tr> + <th>name</th> + <th>type</th> + <th>required</th> + <th>description</th> + <th>example</th> + </tr> + {{#each this.properties}} + <tr> + <td>{{@key}}</td> + <td> + {{#ifeq type "array"}} + {{#items.$ref}} + {{type}}[<a href="{{items.$ref}}">{{basename items.$ref}}</a>] + {{/items.$ref}} + {{^items.$ref}}{{type}}[{{items.type}}]{{/items.$ref}} + {{else}} + {{#$ref}}<a href="{{$ref}}">{{basename $ref}}</a>{{/$ref}} + {{^$ref}}{{type}}{{#format}} ({{format}}){{/format}}{{/$ref}} + {{/ifeq}} + </td> + <td>{{#required}}required{{/required}}{{^required}}optional{{/required}}</td> + <td>{{#description}}{{{description}}}{{/description}}{{^description}}-{{/description}}</td> + <td>{{example}}</td> + </tr> + {{/each}} +</table> +{{/each}} + diff --git a/src/main/resources/operation.hbs b/src/main/resources/operation.hbs new file mode 100644 index 0000000..3d7d88e --- /dev/null +++ b/src/main/resources/operation.hbs @@ -0,0 +1,80 @@ +{{#deprecated}}-deprecated-{{/deprecated}} +<a id="{{operationId}}">{{summary}}</a> + +{{description}} + +{{#if externalDocs.url}}{{externalDocs.description}}. [See external documents for more details]({{externalDocs.url}}) +{{/if}} + +{{#if security}} +#### Security +{{/if}} + +{{#security}} +{{#each this}} +* {{@key}} +{{#this}} * {{this}} +{{/this}} +{{/each}} +{{/security}} + +#### Request + +{{#if consumes}} +**Content-Type: ** {{join consumes ", "}}{{/if}} + +##### Parameters +{{#if parameters}} +<table border="1"> + <tr> + <th>Name</th> + <th>Located in</th> + <th>Required</th> + <th>Description</th> + <th>Default</th> + <th>Schema</th> + </tr> +{{/if}} + +{{#parameters}} +<tr> + <th>{{name}}</th> + <td>{{in}}</td> + <td>{{#if required}}yes{{else}}no{{/if}}</td> + <td> + {{description}}{{#if pattern}} (**Pattern**: `{{pattern}}`){{/if}} + {{#if enum}} + <p> + <b>Allowable values</b>: {{#join enum ", "}} {{this}}{{/join}} + </p> + {{/if}} + </td> + <td>{{#if defaultValue}}{{defaultValue}}{{else}} - {{/if}}</td> +{{#ifeq in "body"}} + <td> + {{#ifeq schema.type "array"}}Array[<a href="{{schema.items.$ref}}">{{basename schema.items.$ref}}</a>]{{/ifeq}} + {{#schema.$ref}}<a href="{{schema.$ref}}">{{basename schema.$ref}}</a> {{/schema.$ref}} + </td> +{{else}} + {{#ifeq type "array"}} + <td>Array[{{items.type}}] ({{collectionFormat}})</td> + {{else}} + <td>{{type}} {{#format}}({{format}}){{/format}}</td> + {{/ifeq}} +{{/ifeq}} +</tr> +{{/parameters}} +{{#if parameters}} +</table> +{{/if}} + + +#### Response + +{{#if produces}}**Content-Type: ** {{join produces ", "}}{{/if}} + + +| Status Code | Reason | Response Model | +|-------------|-------------|----------------| +{{#each responses}}| {{@key}} | {{description}} | {{#schema.$ref}}<a href="{{schema.$ref}}">{{basename schema.$ref}}</a>{{/schema.$ref}}{{#ifeq schema.type "array"}}Array[<a href="{{schema.items.$ref}}">{{basename schema.items.$ref}}</a>]{{/ifeq}}{{^schema}} - {{/schema}}| +{{/each}} diff --git a/src/main/resources/security.hbs b/src/main/resources/security.hbs new file mode 100644 index 0000000..04f86e8 --- /dev/null +++ b/src/main/resources/security.hbs @@ -0,0 +1,88 @@ +{{#each securityDefinitions}} +### {{@key}} +{{#this}} +{{#ifeq type "oauth2"}} +<table> + <tr> + <th>type</th> + <th colspan="2">{{type}}</th> + </tr> +{{#if description}} + <tr> + <th>description</th> + <th colspan="2">{{description}}</th> + </tr> +{{/if}} +{{#if authorizationUrl}} + <tr> + <th>authorizationUrl</th> + <th colspan="2">{{authorizationUrl}}</th> + </tr> +{{/if}} +{{#if flow}} + <tr> + <th>flow</th> + <th colspan="2">{{flow}}</th> + </tr> +{{/if}} +{{#if tokenUrl}} + <tr> + <th>tokenUrl</th> + <th colspan="2">{{tokenUrl}}</th> + </tr> +{{/if}} +{{#if scopes}} + <tr> + <td rowspan="3">scopes</td> +{{#each scopes}} + <td>{{@key}}</td> + <td>{{this}}</td> + </tr> + <tr> +{{/each}} + </tr> +{{/if}} +</table> +{{/ifeq}} +{{#ifeq type "apiKey"}} +<table> + <tr> + <th>type</th> + <th colspan="2">{{type}}</th> + </tr> +{{#if description}} + <tr> + <th>description</th> + <th colspan="2">{{description}}</th> + </tr> +{{/if}} +{{#if name}} + <tr> + <th>name</th> + <th colspan="2">{{name}}</th> + </tr> +{{/if}} +{{#if in}} + <tr> + <th>in</th> + <th colspan="2">{{in}}</th> + </tr> +{{/if}} +</table> +{{/ifeq}} +{{#ifeq type "basic"}} +<table> + <tr> + <th>type</th> + <th colspan="2">{{type}}</th> + </tr> +{{#if description}} + <tr> + <th>description</th> + <th colspan="2">{{description}}</th> + </tr> +{{/if}} +</table> +{{/ifeq}} +{{/this}} +{{/each}}
\ No newline at end of file diff --git a/src/main/resources/strapdown.html.hbs b/src/main/resources/strapdown.html.hbs new file mode 100644 index 0000000..ec02669 --- /dev/null +++ b/src/main/resources/strapdown.html.hbs @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> +<title>API Document</title> + +<xmp theme="united" style="display:none;"> +{{>markdown}} +</xmp> + +<script src="http://strapdownjs.com/v/0.2/strapdown.js"></script> +</html>
\ No newline at end of file diff --git a/src/test/java/org/onap/pomba/common/datatypes/LInterfaceTests.java b/src/test/java/org/onap/pomba/common/datatypes/LInterfaceTests.java new file mode 100644 index 0000000..6b277a6 --- /dev/null +++ b/src/test/java/org/onap/pomba/common/datatypes/LInterfaceTests.java @@ -0,0 +1,51 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class LInterfaceTests { + + @Test + public void testLInterface() { + LInterface aLinterface = new LInterface(); + aLinterface.setName("LInterface name"); + aLinterface.setUuid("Uuid"); + Port aPort = new Port(); + aPort.setName("port name"); + aLinterface.setPort(aPort); + DataQuality dataQuality = new DataQuality(); + dataQuality.setStatus(DataQuality.Status.error); + dataQuality.setErrorText("Test"); + aLinterface.setDataQuality(dataQuality); + Attribute attribute = new Attribute(); + attribute.setName(Attribute.Name.hostName); + aLinterface.addAttribute(attribute); + assertTrue("LInterface name doesn't match", aLinterface.getName().equals("LInterface name")); + assertTrue("LInterface uuid doesn't match", aLinterface.getUuid().equals("Uuid")); + assertTrue("LInterface port name doesn't match", aLinterface.getPort().getName().equals("port name")); + assertTrue("LInterface data quality status doesn't match", aLinterface.getDataQuality().getStatus().equals(DataQuality.Status.error)); + assertTrue("LInterface data quality error text doesn't match", aLinterface.getDataQuality().getErrorText().equals("Test")); + assertTrue("LInterface attribute name doesn't match", aLinterface.getAttributes().get(0).getName().equals(Attribute.Name.hostName)); + assertEquals(aLinterface.getAttributes().size(), 1); + } +} + diff --git a/src/test/java/org/onap/pomba/common/datatypes/LogicalLinkTests.java b/src/test/java/org/onap/pomba/common/datatypes/LogicalLinkTests.java new file mode 100644 index 0000000..d851a17 --- /dev/null +++ b/src/test/java/org/onap/pomba/common/datatypes/LogicalLinkTests.java @@ -0,0 +1,49 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class LogicalLinkTests { + + @Test + public void testLogicalLink() { + LogicalLink aLogicalLink = new LogicalLink(); + aLogicalLink.setName("LogicalLink name"); + aLogicalLink.setUuid("Uuid"); + DataQuality dataQuality = new DataQuality(); + dataQuality.setStatus(DataQuality.Status.error); + dataQuality.setErrorText("Test"); + aLogicalLink.setDataQuality(dataQuality); + Attribute attribute = new Attribute(); + attribute.setName(Attribute.Name.hostName); + aLogicalLink.addAttribute(attribute); + assertTrue("LogicalLink name doesn't match", aLogicalLink.getName().equals("LogicalLink name")); + assertTrue("LogicalLink uuid doesn't match", aLogicalLink.getUuid().equals("Uuid")); + assertTrue("LogicalLink data quality status doesn't match", aLogicalLink.getDataQuality().getStatus().equals(DataQuality.Status.error)); + assertTrue("LogicalLink data quality error text doesn't match", aLogicalLink.getDataQuality().getErrorText().equals("Test")); + assertTrue("LogicalLink attribute name doesn't match", aLogicalLink.getAttributes().get(0).getName().equals(Attribute.Name.hostName)); + assertEquals(aLogicalLink.getAttributes().size(), 1); + } +} + + + diff --git a/src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java b/src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java index ee04a08..b028018 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/ModelContextTests.java @@ -60,22 +60,22 @@ public class ModelContextTests { @Test
public void testSetVf() {
ModelContext modelContext = new ModelContext();
- List<VF> vfList = new ArrayList<VF>();
- VF aVF = new VF();
+ List<VNF> vfList = new ArrayList<VNF>();
+ VNF aVF = new VNF();
aVF.setName("VF name");
vfList.add(aVF);
- modelContext.setVfs(vfList);
- assertEquals(modelContext.getVfs().size(), 1);
+ modelContext.setVnfs(vfList);
+ assertEquals(modelContext.getVnfs().size(), 1);
}
@Test
public void testAddVf() {
ModelContext modelContext = new ModelContext();
- VF aVF = new VF();
+ VNF aVF = new VNF();
aVF.setName("VF name");
modelContext.addVf(aVF);
- assertEquals(modelContext.getVfs().size(), 1);
- assertTrue("ModelContext VF name doesn't match", modelContext.getVfs().get(0).getName().equals("VF name"));
+ assertEquals(modelContext.getVnfs().size(), 1);
+ assertTrue("ModelContext VF name doesn't match", modelContext.getVnfs().get(0).getName().equals("VF name"));
}
}
diff --git a/src/test/java/org/onap/pomba/common/datatypes/NetworkTests.java b/src/test/java/org/onap/pomba/common/datatypes/NetworkTests.java index cfc6129..79b6bc1 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/NetworkTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/NetworkTests.java @@ -30,9 +30,8 @@ public class NetworkTests { public void testNetwork() {
Network aNetwork = new Network();
aNetwork.setName("Network name");
- aNetwork.setInvariantUuid("Invariant Uuid");
+ aNetwork.setModelInvariantUUID("Invariant Uuid");
aNetwork.setUuid("Uuid");
- aNetwork.setType("Type");
DataQuality dataQuality = new DataQuality();
dataQuality.setStatus(Status.error);
dataQuality.setErrorText("Test");
@@ -41,9 +40,8 @@ public class NetworkTests { attribute.setName(Name.hostName);
aNetwork.addAttribute(attribute);
assertTrue("Network name doesn't match", aNetwork.getName().equals("Network name"));
- assertTrue("Network invariant uuid doesn't match", aNetwork.getInvariantUuid().equals("Invariant Uuid"));
+ assertTrue("Network invariant uuid doesn't match", aNetwork.getModelInvariantUUID().equals("Invariant Uuid"));
assertTrue("Network uuid doesn't match", aNetwork.getUuid().equals("Uuid"));
- assertTrue("Network type doesn't match", aNetwork.getType().equals("Type"));
assertTrue("Network data quality status doesn't match", aNetwork.getDataQuality().getStatus().equals(Status.error));
assertTrue("Network data quality error text doesn't match", aNetwork.getDataQuality().getErrorText().equals("Test"));
assertTrue("Network attribute name doesn't match", aNetwork.getAttributes().get(0).getName().equals(Name.hostName));
diff --git a/src/test/java/org/onap/pomba/common/datatypes/PInterfaceTests.java b/src/test/java/org/onap/pomba/common/datatypes/PInterfaceTests.java new file mode 100644 index 0000000..c4c2d55 --- /dev/null +++ b/src/test/java/org/onap/pomba/common/datatypes/PInterfaceTests.java @@ -0,0 +1,51 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class PInterfaceTests { + + @Test + public void testPInterface() { + PInterface aPinterface = new PInterface(); + aPinterface.setName("Pinterface name"); + aPinterface.setUuid("Uuid"); + Port aPort = new Port(); + aPort.setName("port name"); + aPinterface.setPort(aPort); + DataQuality dataQuality = new DataQuality(); + dataQuality.setStatus(DataQuality.Status.error); + dataQuality.setErrorText("Test"); + aPinterface.setDataQuality(dataQuality); + Attribute attribute = new Attribute(); + attribute.setName(Attribute.Name.hostName); + aPinterface.addAttribute(attribute); + assertTrue("PInterface name doesn't match", aPinterface.getName().equals("Pinterface name")); + assertTrue("PInterface uuid doesn't match", aPinterface.getUuid().equals("Uuid")); + assertTrue("PInterface port name doesn't match", aPinterface.getPort().getName().equals("port name")); + assertTrue("PInterface data quality status doesn't match", aPinterface.getDataQuality().getStatus().equals(DataQuality.Status.error)); + assertTrue("PInterface data quality error text doesn't match", aPinterface.getDataQuality().getErrorText().equals("Test")); + assertTrue("PInterface attribute name doesn't match", aPinterface.getAttributes().get(0).getName().equals(Attribute.Name.hostName)); + assertEquals(aPinterface.getAttributes().size(), 1); + } +} + diff --git a/src/test/java/org/onap/pomba/common/datatypes/PNFTests.java b/src/test/java/org/onap/pomba/common/datatypes/PNFTests.java new file mode 100644 index 0000000..0f0af29 --- /dev/null +++ b/src/test/java/org/onap/pomba/common/datatypes/PNFTests.java @@ -0,0 +1,50 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class PNFTests { + + @Test + public void testPNF() { + PNF aPNF = new PNF(); + aPNF.setName("PNF name"); + aPNF.setUuid("Uuid"); + aPNF.setModelVersionID("a-123456"); + aPNF.setModelInvariantUUID("b-12345"); + DataQuality dataQuality = new DataQuality(); + dataQuality.setStatus(DataQuality.Status.error); + dataQuality.setErrorText("Test"); + aPNF.setDataQuality(dataQuality); + Attribute attribute = new Attribute(); + attribute.setName(Attribute.Name.hostName); + aPNF.addAttribute(attribute); + assertTrue("PNF name doesn't match", aPNF.getName().equals("PNF name")); + assertTrue("PNF uuid doesn't match", aPNF.getUuid().equals("Uuid")); + assertTrue("PNF model version id doesn't match", aPNF.getModelVersionID().equals("a-123456")); + assertTrue("PNF model invariant uuid doesn't match", aPNF.getModelInvariantUUID().equals("b-12345")); + assertTrue("PNF data quality status doesn't match", aPNF.getDataQuality().getStatus().equals(DataQuality.Status.error)); + assertTrue("PNF data quality error text doesn't match", aPNF.getDataQuality().getErrorText().equals("Test")); + assertTrue("PNF attribute name doesn't match", aPNF.getAttributes().get(0).getName().equals(Attribute.Name.hostName)); + assertEquals(aPNF.getAttributes().size(), 1); + } +} diff --git a/src/test/java/org/onap/pomba/common/datatypes/PhysicalLinkTests.java b/src/test/java/org/onap/pomba/common/datatypes/PhysicalLinkTests.java new file mode 100644 index 0000000..b973656 --- /dev/null +++ b/src/test/java/org/onap/pomba/common/datatypes/PhysicalLinkTests.java @@ -0,0 +1,48 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class PhysicalLinkTests { + + @Test + public void testPhysicalLink() { + PhysicalLink aPhysicalLink = new PhysicalLink(); + aPhysicalLink.setName("PhysicalLink name"); + aPhysicalLink.setUuid("Uuid"); + DataQuality dataQuality = new DataQuality(); + dataQuality.setStatus(DataQuality.Status.error); + dataQuality.setErrorText("Test"); + aPhysicalLink.setDataQuality(dataQuality); + Attribute attribute = new Attribute(); + attribute.setName(Attribute.Name.hostName); + aPhysicalLink.addAttribute(attribute); + assertTrue("PhysicalLink name doesn't match", aPhysicalLink.getName().equals("PhysicalLink name")); + assertTrue("PhysicalLink uuid doesn't match", aPhysicalLink.getUuid().equals("Uuid")); + assertTrue("PhysicalLink data quality status doesn't match", aPhysicalLink.getDataQuality().getStatus().equals(DataQuality.Status.error)); + assertTrue("PhysicalLink data quality error text doesn't match", aPhysicalLink.getDataQuality().getErrorText().equals("Test")); + assertTrue("PhysicalLink attribute name doesn't match", aPhysicalLink.getAttributes().get(0).getName().equals(Attribute.Name.hostName)); + assertEquals(aPhysicalLink.getAttributes().size(), 1); + } +} + + diff --git a/src/test/java/org/onap/pomba/common/datatypes/PserverTests.java b/src/test/java/org/onap/pomba/common/datatypes/PserverTests.java new file mode 100644 index 0000000..335011f --- /dev/null +++ b/src/test/java/org/onap/pomba/common/datatypes/PserverTests.java @@ -0,0 +1,50 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class PserverTests { + + @Test + public void testPserver() { + Pserver aPserver = new Pserver(); + aPserver.setName("Pserver name"); + aPserver.setUuid("Uuid"); + DataQuality dataQuality = new DataQuality(); + dataQuality.setStatus(DataQuality.Status.error); + dataQuality.setErrorText("Test"); + aPserver.setDataQuality(dataQuality); + Attribute attribute = new Attribute(); + attribute.setName(Attribute.Name.hostName); + aPserver.addAttribute(attribute); + assertTrue("Pserver name doesn't match", aPserver.getName().equals("Pserver name")); + assertTrue("Pserver uuid doesn't match", aPserver.getUuid().equals("Uuid")); + assertTrue("Pserver data quality status doesn't match", aPserver.getDataQuality().getStatus().equals(DataQuality.Status.error)); + assertTrue("Pserver data quality error text doesn't match", aPserver.getDataQuality().getErrorText().equals("Test")); + assertTrue("Pserver attribute name doesn't match", aPserver.getAttributes().get(0).getName().equals(Attribute.Name.hostName)); + List<Attribute> attributeList = aPserver.getAttributes(); + assertEquals(aPserver.getAttributes().size(), 1); + } +} diff --git a/src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java b/src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java index 10f9339..61a158f 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/ServiceTests.java @@ -30,23 +30,16 @@ public class ServiceTests { public void testService() {
Service aService = new Service();
aService.setName("new service");
- aService.setInvariantUuid("Invariant Uuid");
+ aService.setModelInvariantUUID("Invariant Uuid");
aService.setUuid("Uuid");
DataQuality dataQuality = new DataQuality();
dataQuality.setStatus(Status.error);
dataQuality.setErrorText("Test");
aService.setDataQuality(dataQuality);
- Attribute attribute = new Attribute();
- attribute.setName(Name.hostName);
- aService.addAttribute(attribute);
assertTrue("Service Name doesn't match", aService.getName().equals("new service"));
- assertTrue("Invariant Uuid doesn't match", aService.getInvariantUuid().equals("Invariant Uuid"));
+ assertTrue("Invariant Uuid doesn't match", aService.getModelInvariantUUID().equals("Invariant Uuid"));
assertTrue("Uuid doesn't match", aService.getUuid().equals("Uuid"));
assertTrue("Service data quality status doesn't match", aService.getDataQuality().getStatus().equals(Status.error));
assertTrue("Service data quality error text doesn't match", aService.getDataQuality().getErrorText().equals("Test"));
- assertTrue("Service attribute name doesn't match", aService.getAttributes().get(0).getName().equals(Name.hostName));
- List<Attribute> attributeList = aService.getAttributes();
- aService.setAttributes(attributeList);
- assertEquals(aService.getAttributes().size(), 1);
}
}
diff --git a/src/test/java/org/onap/pomba/common/datatypes/VMTests.java b/src/test/java/org/onap/pomba/common/datatypes/VMTests.java index 0d74c00..97ad658 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/VMTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/VMTests.java @@ -30,9 +30,7 @@ public class VMTests { public void testVM() {
VM aVM = new VM();
aVM.setName("VM name");
- aVM.setInvariantUuid("Invariant Uuid");
aVM.setUuid("Uuid");
- aVM.setNfcNamingCode("NFC Naming Code");
DataQuality dataQuality = new DataQuality();
dataQuality.setStatus(Status.error);
dataQuality.setErrorText("Test");
@@ -41,8 +39,6 @@ public class VMTests { attribute.setName(Name.hostName);
aVM.addAttribute(attribute);
assertTrue("VM name doesn't match", aVM.getName().equals("VM name"));
- assertTrue("VM invariant uuid doesn't match", aVM.getInvariantUuid().equals("Invariant Uuid"));
- assertTrue("VM NFC Naming Code doesn't match", aVM.getNfcNamingCode().equals("NFC Naming Code"));
assertTrue("VM uuid doesn't match", aVM.getUuid().equals("Uuid"));
assertTrue("VM data quality status doesn't match", aVM.getDataQuality().getStatus().equals(Status.error));
assertTrue("VM data quality error text doesn't match", aVM.getDataQuality().getErrorText().equals("Test"));
diff --git a/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java b/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java index d4840d2..d415fd8 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/VfModuleTests.java @@ -30,7 +30,7 @@ public class VfModuleTests { public void testVFModule() {
VFModule aVFModule = new VFModule();
aVFModule.setName("Name");
- aVFModule.setInvariantUuid("Invariant Uuid");
+ aVFModule.setModelInvariantUUID("Invariant Uuid");
aVFModule.setUuid("Uuid");
aVFModule.setMaxInstances(10);
aVFModule.setMinInstances(1);
@@ -42,7 +42,7 @@ public class VfModuleTests { attribute.setName(Name.hostName);
aVFModule.addAttribute(attribute);
assertTrue("VFModule Name doesn't match", aVFModule.getName().equals("Name"));
- assertTrue("VFModule Invariant Uuid doesn't match", aVFModule.getInvariantUuid().equals("Invariant Uuid"));
+ assertTrue("VFModule Invariant Uuid doesn't match", aVFModule.getModelInvariantUUID().equals("Invariant Uuid"));
assertTrue("VFModule Uuid doesn't match", aVFModule.getUuid().equals("Uuid"));
assertEquals(aVFModule.getMaxInstances(), 10);
assertEquals(aVFModule.getMinInstances(), 1);
diff --git a/src/test/java/org/onap/pomba/common/datatypes/VfTests.java b/src/test/java/org/onap/pomba/common/datatypes/VnfTests.java index 11978f7..720a89f 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/VfTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/VnfTests.java @@ -1,126 +1,126 @@ -/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2018 Amdocs
- * ============================================================================
- * 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.onap.pomba.common.datatypes;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.onap.pomba.common.datatypes.Attribute.Name;
-import org.onap.pomba.common.datatypes.DataQuality.Status;
-
-public class VfTests {
- @Test
- public void testVF() {
- VF aVF = new VF();
- aVF.setName("VF name");
- aVF.setType("Type");
- aVF.setInvariantUuid("Invariant Uuid");
- aVF.setUuid("Uuid");
- DataQuality dataQuality = new DataQuality();
- dataQuality.setStatus(Status.error);
- dataQuality.setErrorText("Test");
- aVF.setDataQuality(dataQuality);
- Attribute attribute = new Attribute();
- attribute.setName(Name.hostName);
- aVF.addAttribute(attribute);
- assertTrue("VF name doesn't match", aVF.getName().equals("VF name"));
- assertTrue("VF Type doesn't match", aVF.getType().equals("Type"));
- assertTrue("VF Invariant Uuid doesn't match", aVF.getInvariantUuid().equals("Invariant Uuid"));
- assertTrue("VF Uuid doesn't match", aVF.getUuid().equals("Uuid"));
- assertTrue("VF data quality status doesn't match", aVF.getDataQuality().getStatus().equals(Status.error));
- assertTrue("VF data quality error text doesn't match", aVF.getDataQuality().getErrorText().equals("Test"));
- assertTrue("VF attribute name doesn't match", aVF.getAttributes().get(0).getName().equals(Name.hostName));
- List<Attribute> attributeList = aVF.getAttributes();
- aVF.setAttributes(attributeList);
- assertEquals(aVF.getAttributes().size(), 1);
- }
-
- @Test
- public void testSetVFModuleList() {
- VF aVF = new VF();
- List<VFModule> vfModuleList = new ArrayList<VFModule>();
- assertEquals(vfModuleList.size(), 0);
- VFModule vfModule = new VFModule();
- vfModule.setInvariantUuid("Invariant Uuid");
- vfModule.setMaxInstances(10);
- vfModule.setMinInstances(1);
- vfModule.setUuid("Uuid");
- vfModuleList.add(vfModule);
- aVF.setVfModules(vfModuleList);
- assertEquals(vfModuleList.size(), 1);
- }
-
- @Test
- public void testAddVfModule() {
- VF aVF = new VF();
- List<VFModule> vfModuleList = new ArrayList<VFModule>();
- assertEquals(vfModuleList.size(), 0);
- VFModule vfModule = new VFModule();
- vfModule.setInvariantUuid("Invariant Uuid");
- vfModule.setMaxInstances(10);
- vfModule.setMinInstances(1);
- vfModule.setUuid("Uuid");
- vfModuleList.add(vfModule);
- aVF.addVfModule(vfModule);
- assertEquals(vfModuleList.size(), 1);
- }
-
- @Test
- public void testGetVfModules() {
- VF aVF = new VF();
- List<VFModule> vfModuleList = new ArrayList<VFModule>();
- assertEquals(vfModuleList.size(), 0);
- VFModule vfModule = new VFModule();
- vfModule.setInvariantUuid("Invariant Uuid");
- vfModule.setMaxInstances(10);
- vfModule.setMinInstances(1);
- vfModule.setUuid("Uuid");
- vfModuleList.add(vfModule);
- aVF.addVfModule(vfModule);
- List<VFModule> resultVFModules = aVF.getVfModules();
- assertTrue("VF Modules doesn't match",
- ((VFModule) resultVFModules.get(0)).getInvariantUuid().equals("Invariant Uuid"));
- }
-
- @Test
- public void testSetVnfc() {
- VF aVF = new VF();
- List<VNFC> vnfcList = new ArrayList<VNFC>();
- assertEquals(vnfcList.size(), 0);
- VNFC aVNFC = new VNFC();
- aVNFC.setName("VNFC name");
- vnfcList.add(aVNFC);
- aVF.setVnfcs(vnfcList);
- assertTrue("VNFC list item doesn't match", aVF.getVnfcs().get(0).getName().equals("VNFC name"));
- }
-
- @Test
- public void testAddVnfc() {
- VF aVF = new VF();
- assertEquals(aVF.getVnfcs().size(), 0);
- VNFC aVNFC = new VNFC();
- aVNFC.setName("VNFC name");
- aVF.addVnfc(aVNFC);
- assertTrue("VNFC list item doesn't match", aVF.getVnfcs().get(0).getName().equals("VNFC name"));
- }
-}
+/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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.onap.pomba.common.datatypes; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; +import org.onap.pomba.common.datatypes.Attribute.Name; +import org.onap.pomba.common.datatypes.DataQuality.Status; + +public class VnfTests { + @Test + public void testVF() { + VNF aVF = new VNF(); + aVF.setName("VF name"); + aVF.setType("Type"); + aVF.setModelInvariantUUID("Invariant Uuid"); + aVF.setUuid("Uuid"); + DataQuality dataQuality = new DataQuality(); + dataQuality.setStatus(Status.error); + dataQuality.setErrorText("Test"); + aVF.setDataQuality(dataQuality); + Attribute attribute = new Attribute(); + attribute.setName(Name.hostName); + aVF.addAttribute(attribute); + assertTrue("VF name doesn't match", aVF.getName().equals("VF name")); + assertTrue("VF Type doesn't match", aVF.getType().equals("Type")); + assertTrue("VF Invariant Uuid doesn't match", aVF.getModelInvariantUUID().equals("Invariant Uuid")); + assertTrue("VF Uuid doesn't match", aVF.getUuid().equals("Uuid")); + assertTrue("VF data quality status doesn't match", aVF.getDataQuality().getStatus().equals(Status.error)); + assertTrue("VF data quality error text doesn't match", aVF.getDataQuality().getErrorText().equals("Test")); + assertTrue("VF attribute name doesn't match", aVF.getAttributes().get(0).getName().equals(Name.hostName)); + List<Attribute> attributeList = aVF.getAttributes(); + aVF.setAttributes(attributeList); + assertEquals(aVF.getAttributes().size(), 1); + } + + @Test + public void testSetVFModuleList() { + VNF aVF = new VNF(); + List<VFModule> vfModuleList = new ArrayList<VFModule>(); + assertEquals(vfModuleList.size(), 0); + VFModule vfModule = new VFModule(); + vfModule.setModelInvariantUUID("Invariant Uuid"); + vfModule.setMaxInstances(10); + vfModule.setMinInstances(1); + vfModule.setUuid("Uuid"); + vfModuleList.add(vfModule); + aVF.setVfModules(vfModuleList); + assertEquals(vfModuleList.size(), 1); + } + + @Test + public void testAddVfModule() { + VNF aVF = new VNF(); + List<VFModule> vfModuleList = new ArrayList<VFModule>(); + assertEquals(vfModuleList.size(), 0); + VFModule vfModule = new VFModule(); + vfModule.setModelInvariantUUID("Invariant Uuid"); + vfModule.setMaxInstances(10); + vfModule.setMinInstances(1); + vfModule.setUuid("Uuid"); + vfModuleList.add(vfModule); + aVF.addVfModule(vfModule); + assertEquals(vfModuleList.size(), 1); + } + + @Test + public void testGetVfModules() { + VNF aVF = new VNF(); + List<VFModule> vfModuleList = new ArrayList<VFModule>(); + assertEquals(vfModuleList.size(), 0); + VFModule vfModule = new VFModule(); + vfModule.setModelInvariantUUID("Invariant Uuid"); + vfModule.setMaxInstances(10); + vfModule.setMinInstances(1); + vfModule.setUuid("Uuid"); + vfModuleList.add(vfModule); + aVF.addVfModule(vfModule); + List<VFModule> resultVFModules = aVF.getVfModules(); + assertTrue("VF Modules doesn't match", + ((VFModule) resultVFModules.get(0)).getModelInvariantUUID().equals("Invariant Uuid")); + } + + @Test + public void testSetVnfc() { + VNF aVF = new VNF(); + List<VNFC> vnfcList = new ArrayList<VNFC>(); + assertEquals(vnfcList.size(), 0); + VNFC aVNFC = new VNFC(); + aVNFC.setName("VNFC name"); + vnfcList.add(aVNFC); + aVF.setVnfcs(vnfcList); + assertTrue("VNFC list item doesn't match", aVF.getVnfcs().get(0).getName().equals("VNFC name")); + } + + @Test + public void testAddVnfc() { + VNF aVF = new VNF(); + assertEquals(aVF.getVnfcs().size(), 0); + VNFC aVNFC = new VNFC(); + aVNFC.setName("VNFC name"); + aVF.addVnfc(aVNFC); + assertTrue("VNFC list item doesn't match", aVF.getVnfcs().get(0).getName().equals("VNFC name")); + } +} diff --git a/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java b/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java index 628c646..37712a3 100644 --- a/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java +++ b/src/test/java/org/onap/pomba/common/datatypes/VnfcTests.java @@ -30,9 +30,8 @@ public class VnfcTests { public void testVNFC() {
VNFC aVNFC = new VNFC();
aVNFC.setName("VNFC name");
- aVNFC.setInvariantUuid("Invariant Uuid");
+ aVNFC.setModelInvariantUUID("Invariant Uuid");
aVNFC.setUuid("Uuid");
- aVNFC.setType("Type");
DataQuality dataQuality = new DataQuality();
dataQuality.setStatus(Status.error);
dataQuality.setErrorText("Test");
@@ -41,9 +40,8 @@ public class VnfcTests { attribute.setName(Name.hostName);
aVNFC.addAttribute(attribute);
assertTrue("VNFC name doesn't match", aVNFC.getName().equals("VNFC name"));
- assertTrue("VNFC invariant uuid doesn't match", aVNFC.getInvariantUuid().equals("Invariant Uuid"));
+ assertTrue("VNFC invariant uuid doesn't match", aVNFC.getModelInvariantUUID().equals("Invariant Uuid"));
assertTrue("VNFC uuid doesn't match", aVNFC.getUuid().equals("Uuid"));
- assertTrue("VNFC type doesn't match", aVNFC.getType().equals("Type"));
assertTrue("VNFC data quality status doesn't match", aVNFC.getDataQuality().getStatus().equals(Status.error));
assertTrue("VNFC data quality error text doesn't match", aVNFC.getDataQuality().getErrorText().equals("Test"));
assertTrue("VNFC attribute name doesn't match", aVNFC.getAttributes().get(0).getName().equals(Name.hostName));
|