Commit a6e38c65 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added name to node

parent 3dc7c5e2
...@@ -73,7 +73,6 @@ public class ToscaHelper { ...@@ -73,7 +73,6 @@ public class ToscaHelper {
for (String type : toscaInterfaceTypes) { for (String type : toscaInterfaceTypes) {
String derivedFrom = null; String derivedFrom = null;
List<Map<String, Object>> interfaces = api.getTypes(String.valueOf(id), "interface_types", null, type, null, null, null, null, null, derivedFrom); List<Map<String, Object>> interfaces = api.getTypes(String.valueOf(id), "interface_types", null, type, null, null, null, null, null, derivedFrom);
interfaceDefinitions.addAll(interfaces); interfaceDefinitions.addAll(interfaces);
} }
...@@ -85,8 +84,4 @@ public class ToscaHelper { ...@@ -85,8 +84,4 @@ public class ToscaHelper {
return vmTopologyTemplates; return vmTopologyTemplates;
} }
public ToscaTemplate execute() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
} }
package nl.uva.sne.drip.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
/**
* CloudsStormSubMembers
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
public class CloudsStormSubMembers {
@JsonProperty("vmName")
private String vmName = null;
@JsonProperty("address")
private String address = null;
public CloudsStormSubMembers vmName(String vmName) {
this.vmName = vmName;
return this;
}
/**
* Get vmName
*
* @return vmName
*
*/
@ApiModelProperty(value = "")
public String getVmName() {
return vmName;
}
public void setVmName(String vmName) {
this.vmName = vmName;
}
public CloudsStormSubMembers address(String address) {
this.address = address;
return this;
}
/**
* Get address
*
* @return address
*
*/
@ApiModelProperty(value = "")
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormSubMembers cloudsStormSubMembers = (CloudsStormSubMembers) o;
return Objects.equals(this.vmName, cloudsStormSubMembers.vmName)
&& Objects.equals(this.address, cloudsStormSubMembers.address);
}
@Override
public int hashCode() {
return Objects.hash(vmName, address);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormSubMembers {\n");
sb.append(" vmName: ").append(toIndentedString(vmName)).append("\n");
sb.append(" address: ").append(toIndentedString(address)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
/*
* Copyright 2019 S. Koulouzis
*
* 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.
*/
package nl.uva.sne.drip.model; package nl.uva.sne.drip.model;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
/** /**
* * CloudsStormSubTopology
* @author S. Koulouzis
*/ */
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-12-09T15:55:39.959Z[GMT]") @Validated
public class CloudsStormSubTopology { @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
@JsonProperty("topology")
private String topology = null; public class CloudsStormSubTopology {
@JsonProperty("cloudProvider") @JsonProperty("topology")
private String cloudProvider = null; private String topology = null;
@JsonProperty("domain") @JsonProperty("cloudProvider")
private String domain = null; private String cloudProvider = null;
@JsonProperty("status") @JsonProperty("domain")
private String status = null; private String domain = null;
public CloudsStormSubTopology topology(String topology) { @JsonProperty("status")
this.topology = topology; private String status = null;
return this;
} public CloudsStormSubTopology topology(String topology) {
this.topology = topology;
/** return this;
* Get topology }
* @return topology
**/ /**
@ApiModelProperty(value = "") * Get topology
*
* @return topology
*
*/
@ApiModelProperty(value = "")
public String getTopology() { public String getTopology() {
return topology; return topology;
} }
public void setTopology(String topology) { public void setTopology(String topology) {
this.topology = topology; this.topology = topology;
} }
public CloudsStormSubTopology cloudProvider(String cloudProvider) { public CloudsStormSubTopology cloudProvider(String cloudProvider) {
this.cloudProvider = cloudProvider; this.cloudProvider = cloudProvider;
return this; return this;
} }
/** /**
* Get cloudProvider * Get cloudProvider
* @return cloudProvider *
**/ * @return cloudProvider
@ApiModelProperty(value = "") *
*/
@ApiModelProperty(value = "")
public String getCloudProvider() { public String getCloudProvider() {
return cloudProvider; return cloudProvider;
} }
public void setCloudProvider(String cloudProvider) { public void setCloudProvider(String cloudProvider) {
this.cloudProvider = cloudProvider; this.cloudProvider = cloudProvider;
} }
public CloudsStormSubTopology domain(String domain) { public CloudsStormSubTopology domain(String domain) {
this.domain = domain; this.domain = domain;
return this; return this;
} }
/** /**
* Get domain * Get domain
* @return domain *
**/ * @return domain
@ApiModelProperty(value = "") *
*/
@ApiModelProperty(value = "")
public String getDomain() { public String getDomain() {
return domain; return domain;
} }
public void setDomain(String domain) { public void setDomain(String domain) {
this.domain = domain; this.domain = domain;
} }
public CloudsStormSubTopology status(String status) { public CloudsStormSubTopology status(String status) {
this.status = status; this.status = status;
return this; return this;
} }
/** /**
* Get status * Get status
* @return status *
**/ * @return status
@ApiModelProperty(value = "") *
*/
@ApiModelProperty(value = "")
public String getStatus() { public String getStatus() {
return status; return status;
} }
public void setStatus(String status) { public void setStatus(String status) {
this.status = status; this.status = status;
} }
@Override
@Override public boolean equals(java.lang.Object o) {
public boolean equals(java.lang.Object o) { if (this == o) {
if (this == o) { return true;
return true; }
} if (o == null || getClass() != o.getClass()) {
if (o == null || getClass() != o.getClass()) { return false;
return false; }
} CloudsStormSubTopology cloudsStormSubTopology = (CloudsStormSubTopology) o;
CloudsStormSubTopology cloudsStormSubTopology = (CloudsStormSubTopology) o; return Objects.equals(this.topology, cloudsStormSubTopology.topology)
return Objects.equals(this.topology, cloudsStormSubTopology.topology) && && Objects.equals(this.cloudProvider, cloudsStormSubTopology.cloudProvider)
Objects.equals(this.cloudProvider, cloudsStormSubTopology.cloudProvider) && && Objects.equals(this.domain, cloudsStormSubTopology.domain)
Objects.equals(this.domain, cloudsStormSubTopology.domain) && && Objects.equals(this.status, cloudsStormSubTopology.status);
Objects.equals(this.status, cloudsStormSubTopology.status); }
}
@Override
@Override public int hashCode() {
public int hashCode() { return Objects.hash(topology, cloudProvider, domain, status);
return Objects.hash(topology, cloudProvider, domain, status); }
}
@Override
@Override public String toString() {
public String toString() { StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder(); sb.append("class CloudsStormSubTopology {\n");
sb.append("class CloudsStormSubTopology {\n");
sb.append(" topology: ").append(toIndentedString(topology)).append("\n");
sb.append(" topology: ").append(toIndentedString(topology)).append("\n"); sb.append(" cloudProvider: ").append(toIndentedString(cloudProvider)).append("\n");
sb.append(" cloudProvider: ").append(toIndentedString(cloudProvider)).append("\n"); sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append("}");
sb.append("}"); return sb.toString();
return sb.toString(); }
}
/**
/** * Convert the given object to string with each line indented by 4 spaces
* Convert the given object to string with each line indented by 4 spaces * (except the first line).
* (except the first line). */
*/ private String toIndentedString(java.lang.Object o) {
private String toIndentedString(java.lang.Object o) { if (o == null) {
if (o == null) { return "null";
return "null"; }
} return o.toString().replace("\n", "\n ");
return o.toString().replace("\n", "\n "); }
}
} }
package nl.uva.sne.drip.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
/**
* CloudsStormSubnets
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
public class CloudsStormSubnets {
@JsonProperty("name")
private String name = null;
@JsonProperty("subnet")
private String subnet = null;
@JsonProperty("netmask")
private String netmask = null;
@JsonProperty("members")
@Valid
private List<CloudsStormSubMembers> members = null;
public CloudsStormSubnets name(String name) {
this.name = name;
return this;
}
/**
* Get name
*
* @return name
*
*/
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CloudsStormSubnets subnet(String subnet) {
this.subnet = subnet;
return this;
}
/**
* Get subnet
*
* @return subnet
*
*/
@ApiModelProperty(value = "")
public String getSubnet() {
return subnet;
}
public void setSubnet(String subnet) {
this.subnet = subnet;
}
public CloudsStormSubnets netmask(String netmask) {
this.netmask = netmask;
return this;
}
/**
* Get netmask
*
* @return netmask
*
*/
@ApiModelProperty(value = "")
public String getNetmask() {
return netmask;
}
public void setNetmask(String netmask) {
this.netmask = netmask;
}
public CloudsStormSubnets members(List<CloudsStormSubMembers> members) {
this.members = members;
return this;
}
public CloudsStormSubnets addMembersItem(CloudsStormSubMembers membersItem) {
if (this.members == null) {
this.members = new ArrayList<CloudsStormSubMembers>();
}
this.members.add(membersItem);
return this;
}
/**
* Get members
*
* @return members
*
*/
@ApiModelProperty(value = "")
@Valid
public List<CloudsStormSubMembers> getMembers() {
return members;
}
public void setMembers(List<CloudsStormSubMembers> members) {
this.members = members;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormSubnets cloudsStormSubnets = (CloudsStormSubnets) o;
return Objects.equals(this.name, cloudsStormSubnets.name)
&& Objects.equals(this.subnet, cloudsStormSubnets.subnet)
&& Objects.equals(this.netmask, cloudsStormSubnets.netmask)
&& Objects.equals(this.members, cloudsStormSubnets.members);
}
@Override
public int hashCode() {
return Objects.hash(name, subnet, netmask, members);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormSubnets {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" subnet: ").append(toIndentedString(subnet)).append("\n");
sb.append(" netmask: ").append(toIndentedString(netmask)).append("\n");
sb.append(" members: ").append(toIndentedString(members)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
/*
* Copyright 2019 S. Koulouzis
*
* 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.
*/
package nl.uva.sne.drip.model; package nl.uva.sne.drip.model;
import java.util.Objects; import java.util.Objects;
import com.google.gson.annotations.SerializedName; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
/** /**
* * CloudsStormTopTopology
* @author S. Koulouzis
*/ */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2019-12-09T16:51:48.830052+01:00[Europe/Amsterdam]") @Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
public class CloudsStormTopTopology { public class CloudsStormTopTopology {
public static final String SERIALIZED_NAME_USER_NAME = "userName";
@SerializedName(SERIALIZED_NAME_USER_NAME)
private String userName;
public static final String SERIALIZED_NAME_PUBLIC_KEY_PATH = "publicKeyPath"; @JsonProperty("userName")
@SerializedName(SERIALIZED_NAME_PUBLIC_KEY_PATH) private String userName = null;
private String publicKeyPath;
@JsonProperty("publicKeyPath")
private String publicKeyPath = null;
public static final String SERIALIZED_NAME_TOPOLOGIES = "topologies"; @JsonProperty("topologies")
@SerializedName(SERIALIZED_NAME_TOPOLOGIES) @Valid
private List<CloudsStormSubTopology> topologies = null; private List<CloudsStormSubTopology> topologies = null;
@JsonProperty("subnets")
@Valid
private List<CloudsStormSubnets> subnets = null;
public CloudsStormTopTopology userName(String userName) {
this.userName = userName;
return this;
}
/**
* Get userName
*
* @return userName
*
*/
@ApiModelProperty(value = "")
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public CloudsStormTopTopology publicKeyPath(String publicKeyPath) {
this.publicKeyPath = publicKeyPath;
return this;
}
/**
* Get publicKeyPath
*
* @return publicKeyPath
*
*/
@ApiModelProperty(value = "")
public String getPublicKeyPath() {
return publicKeyPath;
}
public void setPublicKeyPath(String publicKeyPath) {
this.publicKeyPath = publicKeyPath;
}
public CloudsStormTopTopology topologies(List<CloudsStormSubTopology> topologies) {
this.topologies = topologies;
return this;
}
public CloudsStormTopTopology addTopologiesItem(CloudsStormSubTopology topologiesItem) {
if (this.topologies == null) {
this.topologies = new ArrayList<CloudsStormSubTopology>();
}
this.topologies.add(topologiesItem);
return this;
}
public CloudsStormTopTopology userName(String userName) { /**
* Get topologies
this.userName = userName; *
return this; * @return topologies
} *
*/
@ApiModelProperty(value = "")
/** @Valid
* Get userName
* @return userName public List<CloudsStormSubTopology> getTopologies() {
**/ return topologies;
@javax.annotation.Nullable }
@ApiModelProperty(value = "")
public void setTopologies(List<CloudsStormSubTopology> topologies) {
public String getUserName() { this.topologies = topologies;
return userName; }
}
public CloudsStormTopTopology subnets(List<CloudsStormSubnets> subnets) {
this.subnets = subnets;
public void setUserName(String userName) { return this;
this.userName = userName; }
}
public CloudsStormTopTopology addSubnetsItem(CloudsStormSubnets subnetsItem) {
if (this.subnets == null) {
public CloudsStormTopTopology publicKeyPath(String publicKeyPath) { this.subnets = new ArrayList<CloudsStormSubnets>();
}
this.publicKeyPath = publicKeyPath; this.subnets.add(subnetsItem);
return this; return this;
} }
/** /**
* Get publicKeyPath * Get subnets
* @return publicKeyPath *
**/ * @return subnets
@javax.annotation.Nullable *
@ApiModelProperty(value = "") */
@ApiModelProperty(value = "")
public String getPublicKeyPath() {
return publicKeyPath; @Valid
}
public List<CloudsStormSubnets> getSubnets() {
return subnets;
public void setPublicKeyPath(String publicKeyPath) { }
this.publicKeyPath = publicKeyPath;
} public void setSubnets(List<CloudsStormSubnets> subnets) {
this.subnets = subnets;
}
public CloudsStormTopTopology topologies(List<CloudsStormSubTopology> topologies) {
@Override
this.topologies = topologies; public boolean equals(java.lang.Object o) {
return this; if (this == o) {
} return true;
}
public CloudsStormTopTopology addTopologiesItem(CloudsStormSubTopology topologiesItem) { if (o == null || getClass() != o.getClass()) {
if (this.topologies == null) { return false;
this.topologies = new ArrayList<CloudsStormSubTopology>(); }
} CloudsStormTopTopology cloudsStormTopTopology = (CloudsStormTopTopology) o;
this.topologies.add(topologiesItem); return Objects.equals(this.userName, cloudsStormTopTopology.userName)
return this; && Objects.equals(this.publicKeyPath, cloudsStormTopTopology.publicKeyPath)
} && Objects.equals(this.topologies, cloudsStormTopTopology.topologies)
&& Objects.equals(this.subnets, cloudsStormTopTopology.subnets);
/** }
* Get topologies
* @return topologies @Override
**/ public int hashCode() {
@javax.annotation.Nullable return Objects.hash(userName, publicKeyPath, topologies, subnets);
@ApiModelProperty(value = "") }
public List<CloudsStormSubTopology> getTopologies() { @Override
return topologies; public String toString() {
} StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormTopTopology {\n");
public void setTopologies(List<CloudsStormSubTopology> topologies) { sb.append(" userName: ").append(toIndentedString(userName)).append("\n");
this.topologies = topologies; sb.append(" publicKeyPath: ").append(toIndentedString(publicKeyPath)).append("\n");
} sb.append(" topologies: ").append(toIndentedString(topologies)).append("\n");
sb.append(" subnets: ").append(toIndentedString(subnets)).append("\n");
sb.append("}");
@Override return sb.toString();
public boolean equals(java.lang.Object o) { }
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormTopTopology cloudsStormTopTopology = (CloudsStormTopTopology) o;
return Objects.equals(this.userName, cloudsStormTopTopology.userName) &&
Objects.equals(this.publicKeyPath, cloudsStormTopTopology.publicKeyPath) &&
Objects.equals(this.topologies, cloudsStormTopTopology.topologies);
}
@Override /**
public int hashCode() { * Convert the given object to string with each line indented by 4 spaces
return Objects.hash(userName, publicKeyPath, topologies); * (except the first line).
} */
private String toIndentedString(java.lang.Object o) {
if (o == null) {
@Override return "null";
public String toString() { }
StringBuilder sb = new StringBuilder(); return o.toString().replace("\n", "\n ");
sb.append("class CloudsStormTopTopology {\n");
sb.append(" userName: ").append(toIndentedString(userName)).append("\n");
sb.append(" publicKeyPath: ").append(toIndentedString(publicKeyPath)).append("\n");
sb.append(" topologies: ").append(toIndentedString(topologies)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
} }
return o.toString().replace("\n", "\n "); }
}
}
\ No newline at end of file
package nl.uva.sne.drip.model; package nl.uva.sne.drip.model;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -14,10 +14,9 @@ import org.springframework.data.annotation.Id; ...@@ -14,10 +14,9 @@ import org.springframework.data.annotation.Id;
* Credentials * Credentials
*/ */
@Validated @Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-06T13:31:49.386Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Credentials {
public class Credentials {
/** /**
* @return the id * @return the id
*/ */
...@@ -33,8 +32,10 @@ public class Credentials { ...@@ -33,8 +32,10 @@ public class Credentials {
} }
@Id @Id
@JsonIgnore
private String id; private String id;
@JsonProperty("protocol") @JsonProperty("protocol")
private String protocol = null; private String protocol = null;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
package nl.uva.sne.drip.model; package nl.uva.sne.drip.model;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
......
package nl.uva.sne.drip.model; package nl.uva.sne.drip.model;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -15,358 +15,382 @@ import javax.validation.Valid; ...@@ -15,358 +15,382 @@ import javax.validation.Valid;
* NodeTemplate * NodeTemplate
*/ */
@Validated @Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-06T13:31:49.386Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class NodeTemplate {
@JsonProperty("derived_from")
private String derivedFrom = null;
@JsonProperty("properties")
@Valid
private Map<String, Object> properties = null;
@JsonProperty("requirements") public class NodeTemplate {
@Valid
private List<Map<String, Object>> requirements = null;
@JsonProperty("interfaces") public String getId() {
@Valid return name;
private Map<String, Object> interfaces = null; }
/**
* @param id the id to set
*/
public void setId(String id) {
this.name = id;
}
@JsonIgnore
private String name;
@JsonProperty("derived_from")
private String derivedFrom = null;
@JsonProperty("properties")
@Valid
private Map<String, Object> properties = null;
@JsonProperty("requirements")
@Valid
private List<Map<String, Object>> requirements = null;
@JsonProperty("interfaces")
@Valid
private Map<String, Object> interfaces = null;
@JsonProperty("capabilities")
@Valid
private Map<String, Object> capabilities = null;
@JsonProperty("type")
private String type = null;
@JsonProperty("capabilities") @JsonProperty("description")
@Valid private String description = null;
private Map<String, Object> capabilities = null;
@JsonProperty("type") @JsonProperty("directives")
private String type = null; @Valid
private List<String> directives = null;
@JsonProperty("description")
private String description = null;
@JsonProperty("directives")
@Valid
private List<String> directives = null;
@JsonProperty("attributes")
@Valid
private Map<String, Object> attributes = null;
@JsonProperty("artifacts")
@Valid
private Map<String, Object> artifacts = null;
public NodeTemplate derivedFrom(String derivedFrom) {
this.derivedFrom = derivedFrom;
return this;
}
/** @JsonProperty("attributes")
* Get derivedFrom @Valid
* @return derivedFrom private Map<String, Object> attributes = null;
**/
@ApiModelProperty(value = "")
@JsonProperty("artifacts")
@Valid
private Map<String, Object> artifacts = null;
public String getDerivedFrom() { public NodeTemplate derivedFrom(String derivedFrom) {
return derivedFrom; this.derivedFrom = derivedFrom;
} return this;
public void setDerivedFrom(String derivedFrom) {
this.derivedFrom = derivedFrom;
}
public NodeTemplate properties(Map<String, Object> properties) {
this.properties = properties;
return this;
}
public NodeTemplate putPropertiesItem(String key, Object propertiesItem) {
if (this.properties == null) {
this.properties = new HashMap<String, Object>();
} }
this.properties.put(key, propertiesItem);
return this;
}
/** /**
* Get properties * Get derivedFrom
* @return properties *
**/ * @return derivedFrom
@ApiModelProperty(value = "") *
*/
@ApiModelProperty(value = "")
public String getDerivedFrom() {
return derivedFrom;
}
public Map<String, Object> getProperties() { public void setDerivedFrom(String derivedFrom) {
return properties; this.derivedFrom = derivedFrom;
} }
public void setProperties(Map<String, Object> properties) {
this.properties = properties;
}
public NodeTemplate requirements(List<Map<String, Object>> requirements) {
this.requirements = requirements;
return this;
}
public NodeTemplate addRequirementsItem(Map<String, Object> requirementsItem) {
if (this.requirements == null) {
this.requirements = new ArrayList<Map<String, Object>>();
}
this.requirements.add(requirementsItem);
return this;
}
/**
* Get requirements
* @return requirements
**/
@ApiModelProperty(value = "")
@Valid public NodeTemplate properties(Map<String, Object> properties) {
this.properties = properties;
return this;
}
public List<Map<String, Object>> getRequirements() { public NodeTemplate putPropertiesItem(String key, Object propertiesItem) {
return requirements; if (this.properties == null) {
} this.properties = new HashMap<String, Object>();
}
this.properties.put(key, propertiesItem);
return this;
}
public void setRequirements(List<Map<String, Object>> requirements) { /**
this.requirements = requirements; * Get properties
} *
* @return properties
*
*/
@ApiModelProperty(value = "")
public NodeTemplate interfaces(Map<String, Object> interfaces) { public Map<String, Object> getProperties() {
this.interfaces = interfaces; return properties;
return this; }
}
public NodeTemplate putInterfacesItem(String key, Object interfacesItem) { public void setProperties(Map<String, Object> properties) {
if (this.interfaces == null) { this.properties = properties;
this.interfaces = new HashMap<String, Object>();
} }
this.interfaces.put(key, interfacesItem);
return this;
}
/**
* Get interfaces
* @return interfaces
**/
@ApiModelProperty(value = "")
public NodeTemplate requirements(List<Map<String, Object>> requirements) {
this.requirements = requirements;
return this;
}
public Map<String, Object> getInterfaces() { public NodeTemplate addRequirementsItem(Map<String, Object> requirementsItem) {
return interfaces; if (this.requirements == null) {
} this.requirements = new ArrayList<Map<String, Object>>();
}
this.requirements.add(requirementsItem);
return this;
}
public void setInterfaces(Map<String, Object> interfaces) { /**
this.interfaces = interfaces; * Get requirements
} *
* @return requirements
*
*/
@ApiModelProperty(value = "")
public NodeTemplate capabilities(Map<String, Object> capabilities) { @Valid
this.capabilities = capabilities;
return this;
}
public NodeTemplate putCapabilitiesItem(String key, Object capabilitiesItem) { public List<Map<String, Object>> getRequirements() {
if (this.capabilities == null) { return requirements;
this.capabilities = new HashMap<String, Object>();
} }
this.capabilities.put(key, capabilitiesItem);
return this;
}
/**
* Get capabilities
* @return capabilities
**/
@ApiModelProperty(value = "")
public void setRequirements(List<Map<String, Object>> requirements) {
this.requirements = requirements;
}
public Map<String, Object> getCapabilities() { public NodeTemplate interfaces(Map<String, Object> interfaces) {
return capabilities; this.interfaces = interfaces;
} return this;
}
public void setCapabilities(Map<String, Object> capabilities) { public NodeTemplate putInterfacesItem(String key, Object interfacesItem) {
this.capabilities = capabilities; if (this.interfaces == null) {
} this.interfaces = new HashMap<String, Object>();
}
this.interfaces.put(key, interfacesItem);
return this;
}
public NodeTemplate type(String type) { /**
this.type = type; * Get interfaces
return this; *
} * @return interfaces
*
*/
@ApiModelProperty(value = "")
/** public Map<String, Object> getInterfaces() {
* Get type return interfaces;
* @return type }
**/
@ApiModelProperty(value = "")
public void setInterfaces(Map<String, Object> interfaces) {
this.interfaces = interfaces;
}
public String getType() { public NodeTemplate capabilities(Map<String, Object> capabilities) {
return type; this.capabilities = capabilities;
} return this;
}
public void setType(String type) {
this.type = type;
}
public NodeTemplate description(String description) { public NodeTemplate putCapabilitiesItem(String key, Object capabilitiesItem) {
this.description = description; if (this.capabilities == null) {
return this; this.capabilities = new HashMap<String, Object>();
} }
this.capabilities.put(key, capabilitiesItem);
return this;
}
/** /**
* Get description * Get capabilities
* @return description *
**/ * @return capabilities
@ApiModelProperty(value = "") *
*/
@ApiModelProperty(value = "")
public Map<String, Object> getCapabilities() {
return capabilities;
}
public String getDescription() { public void setCapabilities(Map<String, Object> capabilities) {
return description; this.capabilities = capabilities;
} }
public void setDescription(String description) { public NodeTemplate type(String type) {
this.description = description; this.type = type;
} return this;
}
public NodeTemplate directives(List<String> directives) { /**
this.directives = directives; * Get type
return this; *
} * @return type
*
public NodeTemplate addDirectivesItem(String directivesItem) { */
if (this.directives == null) { @ApiModelProperty(value = "")
this.directives = new ArrayList<String>();
} public String getType() {
this.directives.add(directivesItem); return type;
return this; }
}
public void setType(String type) {
/** this.type = type;
* Get directives }
* @return directives
**/ public NodeTemplate description(String description) {
@ApiModelProperty(value = "") this.description = description;
return this;
}
public List<String> getDirectives() {
return directives; /**
} * Get description
*
public void setDirectives(List<String> directives) { * @return description
this.directives = directives; *
} */
@ApiModelProperty(value = "")
public NodeTemplate attributes(Map<String, Object> attributes) {
this.attributes = attributes; public String getDescription() {
return this; return description;
} }
public NodeTemplate putAttributesItem(String key, Object attributesItem) {
if (this.attributes == null) {
this.attributes = new HashMap<String, Object>();
}
this.attributes.put(key, attributesItem);
return this;
}
/**
* Get attributes
* @return attributes
**/
@ApiModelProperty(value = "")
public Map<String, Object> getAttributes() {
return attributes;
}
public void setAttributes(Map<String, Object> attributes) {
this.attributes = attributes;
}
public NodeTemplate artifacts(Map<String, Object> artifacts) {
this.artifacts = artifacts;
return this;
}
public NodeTemplate putArtifactsItem(String key, Object artifactsItem) {
if (this.artifacts == null) {
this.artifacts = new HashMap<String, Object>();
}
this.artifacts.put(key, artifactsItem);
return this;
}
/**
* Get artifacts
* @return artifacts
**/
@ApiModelProperty(value = "")
public Map<String, Object> getArtifacts() {
return artifacts;
}
public void setArtifacts(Map<String, Object> artifacts) {
this.artifacts = artifacts;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NodeTemplate nodeTemplate2 = (NodeTemplate) o;
return Objects.equals(this.derivedFrom, nodeTemplate2.derivedFrom) &&
Objects.equals(this.properties, nodeTemplate2.properties) &&
Objects.equals(this.requirements, nodeTemplate2.requirements) &&
Objects.equals(this.interfaces, nodeTemplate2.interfaces) &&
Objects.equals(this.capabilities, nodeTemplate2.capabilities) &&
Objects.equals(this.type, nodeTemplate2.type) &&
Objects.equals(this.description, nodeTemplate2.description) &&
Objects.equals(this.directives, nodeTemplate2.directives) &&
Objects.equals(this.attributes, nodeTemplate2.attributes) &&
Objects.equals(this.artifacts, nodeTemplate2.artifacts);
}
@Override
public int hashCode() {
return Objects.hash(derivedFrom, properties, requirements, interfaces, capabilities, type, description, directives, attributes, artifacts);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class NodeTemplate2 {\n");
sb.append(" derivedFrom: ").append(toIndentedString(derivedFrom)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append(" requirements: ").append(toIndentedString(requirements)).append("\n");
sb.append(" interfaces: ").append(toIndentedString(interfaces)).append("\n");
sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" directives: ").append(toIndentedString(directives)).append("\n");
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
sb.append(" artifacts: ").append(toIndentedString(artifacts)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
public void setDescription(String description) {
this.description = description;
}
public NodeTemplate directives(List<String> directives) {
this.directives = directives;
return this;
}
public NodeTemplate addDirectivesItem(String directivesItem) {
if (this.directives == null) {
this.directives = new ArrayList<String>();
}
this.directives.add(directivesItem);
return this;
}
/**
* Get directives
*
* @return directives
*
*/
@ApiModelProperty(value = "")
public List<String> getDirectives() {
return directives;
}
public void setDirectives(List<String> directives) {
this.directives = directives;
}
public NodeTemplate attributes(Map<String, Object> attributes) {
this.attributes = attributes;
return this;
}
public NodeTemplate putAttributesItem(String key, Object attributesItem) {
if (this.attributes == null) {
this.attributes = new HashMap<String, Object>();
}
this.attributes.put(key, attributesItem);
return this;
}
/**
* Get attributes
*
* @return attributes
*
*/
@ApiModelProperty(value = "")
public Map<String, Object> getAttributes() {
return attributes;
}
public void setAttributes(Map<String, Object> attributes) {
this.attributes = attributes;
}
public NodeTemplate artifacts(Map<String, Object> artifacts) {
this.artifacts = artifacts;
return this;
}
public NodeTemplate putArtifactsItem(String key, Object artifactsItem) {
if (this.artifacts == null) {
this.artifacts = new HashMap<String, Object>();
}
this.artifacts.put(key, artifactsItem);
return this;
}
/**
* Get artifacts
*
* @return artifacts
*
*/
@ApiModelProperty(value = "")
public Map<String, Object> getArtifacts() {
return artifacts;
}
public void setArtifacts(Map<String, Object> artifacts) {
this.artifacts = artifacts;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NodeTemplate nodeTemplate = (NodeTemplate) o;
return Objects.equals(this.derivedFrom, nodeTemplate.derivedFrom)
&& Objects.equals(this.properties, nodeTemplate.properties)
&& Objects.equals(this.requirements, nodeTemplate.requirements)
&& Objects.equals(this.interfaces, nodeTemplate.interfaces)
&& Objects.equals(this.capabilities, nodeTemplate.capabilities)
&& Objects.equals(this.type, nodeTemplate.type)
&& Objects.equals(this.description, nodeTemplate.description)
&& Objects.equals(this.directives, nodeTemplate.directives)
&& Objects.equals(this.attributes, nodeTemplate.attributes)
&& Objects.equals(this.artifacts, nodeTemplate.artifacts);
}
@Override
public int hashCode() {
return Objects.hash(derivedFrom, properties, requirements, interfaces, capabilities, type, description, directives, attributes, artifacts);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class NodeTemplate {\n");
sb.append(" derivedFrom: ").append(toIndentedString(derivedFrom)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append(" requirements: ").append(toIndentedString(requirements)).append("\n");
sb.append(" interfaces: ").append(toIndentedString(interfaces)).append("\n");
sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" directives: ").append(toIndentedString(directives)).append("\n");
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
sb.append(" artifacts: ").append(toIndentedString(artifacts)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
package nl.uva.sne.drip.model; package nl.uva.sne.drip.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -15,309 +14,318 @@ import javax.validation.Valid; ...@@ -15,309 +14,318 @@ import javax.validation.Valid;
* TopologyTemplate * TopologyTemplate
*/ */
@Validated @Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-06T13:31:49.386Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TopologyTemplate {
@JsonProperty("description")
private String description = null;
@JsonProperty("inputs")
@Valid
private Map<String, String> inputs = null;
@JsonProperty("node_templates")
@Valid
private Map<String, NodeTemplate> nodeTemplates = null;
@JsonProperty("relationship_templates")
@Valid
private Map<String, Object> relationshipTemplates = null;
@JsonProperty("outputs")
@Valid
private Map<String, Object> outputs = null;
@JsonProperty("groups")
@Valid
private Map<String, Object> groups = null;
@JsonProperty("substitution_mappings")
@Valid
private Map<String, Object> substitutionMappings = null;
@JsonProperty("policies")
@Valid
private List<Map<String, Object>> policies = null;
public TopologyTemplate description(String description) {
this.description = description;
return this;
}
/** public class TopologyTemplate {
* Get description
* @return description
**/
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public TopologyTemplate inputs(Map<String, String> inputs) {
this.inputs = inputs;
return this;
}
public TopologyTemplate putInputsItem(String key, String inputsItem) { @JsonProperty("description")
if (this.inputs == null) { private String description = null;
this.inputs = new HashMap<String, String>();
@JsonProperty("inputs")
@Valid
private Map<String, String> inputs = null;
@JsonProperty("node_templates")
@Valid
private Map<String, NodeTemplate> nodeTemplates = null;
@JsonProperty("relationship_templates")
@Valid
private Map<String, Object> relationshipTemplates = null;
@JsonProperty("outputs")
@Valid
private Map<String, Object> outputs = null;
@JsonProperty("groups")
@Valid
private Map<String, Object> groups = null;
@JsonProperty("substitution_mappings")
@Valid
private Map<String, Object> substitutionMappings = null;
@JsonProperty("policies")
@Valid
private List<Map<String, Object>> policies = null;
public TopologyTemplate description(String description) {
this.description = description;
return this;
} }
this.inputs.put(key, inputsItem);
return this;
}
/** /**
* Get inputs * Get description
* @return inputs *
**/ * @return description
@ApiModelProperty(value = "") *
*/
@ApiModelProperty(value = "")
public Map<String, String> getInputs() {
return inputs; public String getDescription() {
} return description;
}
public void setInputs(Map<String, String> inputs) {
this.inputs = inputs;
}
public TopologyTemplate nodeTemplates(Map<String, NodeTemplate> nodeTemplates) {
this.nodeTemplates = nodeTemplates;
return this;
}
public TopologyTemplate putNodeTemplatesItem(String key, NodeTemplate nodeTemplatesItem) { public void setDescription(String description) {
if (this.nodeTemplates == null) { this.description = description;
this.nodeTemplates = new HashMap<String, NodeTemplate>();
} }
this.nodeTemplates.put(key, nodeTemplatesItem);
return this;
}
/** public TopologyTemplate inputs(Map<String, String> inputs) {
* Get nodeTemplates this.inputs = inputs;
* @return nodeTemplates return this;
**/ }
@ApiModelProperty(value = "")
@Valid
public Map<String, NodeTemplate> getNodeTemplates() {
return nodeTemplates;
}
public void setNodeTemplates(Map<String, NodeTemplate> nodeTemplates) {
this.nodeTemplates = nodeTemplates;
}
public TopologyTemplate relationshipTemplates(Map<String, Object> relationshipTemplates) {
this.relationshipTemplates = relationshipTemplates;
return this;
}
public TopologyTemplate putRelationshipTemplatesItem(String key, Object relationshipTemplatesItem) { public TopologyTemplate putInputsItem(String key, String inputsItem) {
if (this.relationshipTemplates == null) { if (this.inputs == null) {
this.relationshipTemplates = new HashMap<String, Object>(); this.inputs = new HashMap<String, String>();
}
this.inputs.put(key, inputsItem);
return this;
} }
this.relationshipTemplates.put(key, relationshipTemplatesItem);
return this;
}
/** /**
* Get relationshipTemplates * Get inputs
* @return relationshipTemplates *
**/ * @return inputs
@ApiModelProperty(value = "") *
*/
@ApiModelProperty(value = "")
public Map<String, String> getInputs() {
return inputs;
}
public Map<String, Object> getRelationshipTemplates() { public void setInputs(Map<String, String> inputs) {
return relationshipTemplates; this.inputs = inputs;
} }
public void setRelationshipTemplates(Map<String, Object> relationshipTemplates) {
this.relationshipTemplates = relationshipTemplates;
}
public TopologyTemplate outputs(Map<String, Object> outputs) {
this.outputs = outputs;
return this;
}
public TopologyTemplate putOutputsItem(String key, Object outputsItem) { public TopologyTemplate nodeTemplates(Map<String, NodeTemplate> nodeTemplates) {
if (this.outputs == null) { this.nodeTemplates = nodeTemplates;
this.outputs = new HashMap<String, Object>(); return this;
} }
this.outputs.put(key, outputsItem);
return this;
}
/** public TopologyTemplate putNodeTemplatesItem(String key, NodeTemplate nodeTemplatesItem) {
* Get outputs if (this.nodeTemplates == null) {
* @return outputs this.nodeTemplates = new HashMap<String, NodeTemplate>();
**/ }
@ApiModelProperty(value = "") this.nodeTemplates.put(key, nodeTemplatesItem);
return this;
}
/**
* Get nodeTemplates
*
* @return nodeTemplates
*
*/
@ApiModelProperty(value = "")
public Map<String, Object> getOutputs() { @Valid
return outputs;
}
public void setOutputs(Map<String, Object> outputs) { public Map<String, NodeTemplate> getNodeTemplates() {
this.outputs = outputs; return nodeTemplates;
} }
public TopologyTemplate groups(Map<String, Object> groups) { public void setNodeTemplates(Map<String, NodeTemplate> nodeTemplates) {
this.groups = groups; this.nodeTemplates = nodeTemplates;
return this; }
}
public TopologyTemplate putGroupsItem(String key, Object groupsItem) { public TopologyTemplate relationshipTemplates(Map<String, Object> relationshipTemplates) {
if (this.groups == null) { this.relationshipTemplates = relationshipTemplates;
this.groups = new HashMap<String, Object>(); return this;
} }
this.groups.put(key, groupsItem);
return this; public TopologyTemplate putRelationshipTemplatesItem(String key, Object relationshipTemplatesItem) {
} if (this.relationshipTemplates == null) {
this.relationshipTemplates = new HashMap<String, Object>();
/** }
* Get groups this.relationshipTemplates.put(key, relationshipTemplatesItem);
* @return groups return this;
**/ }
@ApiModelProperty(value = "")
/**
* Get relationshipTemplates
public Map<String, Object> getGroups() { *
return groups; * @return relationshipTemplates
} *
*/
public void setGroups(Map<String, Object> groups) { @ApiModelProperty(value = "")
this.groups = groups;
} public Map<String, Object> getRelationshipTemplates() {
return relationshipTemplates;
public TopologyTemplate substitutionMappings(Map<String, Object> substitutionMappings) { }
this.substitutionMappings = substitutionMappings;
return this; public void setRelationshipTemplates(Map<String, Object> relationshipTemplates) {
} this.relationshipTemplates = relationshipTemplates;
}
public TopologyTemplate putSubstitutionMappingsItem(String key, Object substitutionMappingsItem) {
if (this.substitutionMappings == null) { public TopologyTemplate outputs(Map<String, Object> outputs) {
this.substitutionMappings = new HashMap<String, Object>(); this.outputs = outputs;
} return this;
this.substitutionMappings.put(key, substitutionMappingsItem); }
return this;
} public TopologyTemplate putOutputsItem(String key, Object outputsItem) {
if (this.outputs == null) {
/** this.outputs = new HashMap<String, Object>();
* Get substitutionMappings }
* @return substitutionMappings this.outputs.put(key, outputsItem);
**/ return this;
@ApiModelProperty(value = "") }
/**
public Map<String, Object> getSubstitutionMappings() { * Get outputs
return substitutionMappings; *
} * @return outputs
*
public void setSubstitutionMappings(Map<String, Object> substitutionMappings) { */
this.substitutionMappings = substitutionMappings; @ApiModelProperty(value = "")
}
public Map<String, Object> getOutputs() {
public TopologyTemplate policies(List<Map<String, Object>> policies) { return outputs;
this.policies = policies; }
return this;
} public void setOutputs(Map<String, Object> outputs) {
this.outputs = outputs;
public TopologyTemplate addPoliciesItem(Map<String, Object> policiesItem) { }
if (this.policies == null) {
this.policies = new ArrayList<Map<String, Object>>(); public TopologyTemplate groups(Map<String, Object> groups) {
} this.groups = groups;
this.policies.add(policiesItem); return this;
return this; }
}
public TopologyTemplate putGroupsItem(String key, Object groupsItem) {
/** if (this.groups == null) {
* Get policies this.groups = new HashMap<String, Object>();
* @return policies }
**/ this.groups.put(key, groupsItem);
@ApiModelProperty(value = "") return this;
}
@Valid
/**
public List<Map<String, Object>> getPolicies() { * Get groups
return policies; *
} * @return groups
*
public void setPolicies(List<Map<String, Object>> policies) { */
this.policies = policies; @ApiModelProperty(value = "")
}
public Map<String, Object> getGroups() {
return groups;
@Override }
public boolean equals(java.lang.Object o) {
if (this == o) { public void setGroups(Map<String, Object> groups) {
return true; this.groups = groups;
} }
if (o == null || getClass() != o.getClass()) {
return false; public TopologyTemplate substitutionMappings(Map<String, Object> substitutionMappings) {
} this.substitutionMappings = substitutionMappings;
TopologyTemplate topologyTemplate2 = (TopologyTemplate) o; return this;
return Objects.equals(this.description, topologyTemplate2.description) && }
Objects.equals(this.inputs, topologyTemplate2.inputs) &&
Objects.equals(this.nodeTemplates, topologyTemplate2.nodeTemplates) && public TopologyTemplate putSubstitutionMappingsItem(String key, Object substitutionMappingsItem) {
Objects.equals(this.relationshipTemplates, topologyTemplate2.relationshipTemplates) && if (this.substitutionMappings == null) {
Objects.equals(this.outputs, topologyTemplate2.outputs) && this.substitutionMappings = new HashMap<String, Object>();
Objects.equals(this.groups, topologyTemplate2.groups) && }
Objects.equals(this.substitutionMappings, topologyTemplate2.substitutionMappings) && this.substitutionMappings.put(key, substitutionMappingsItem);
Objects.equals(this.policies, topologyTemplate2.policies); return this;
} }
@Override
public int hashCode() {
return Objects.hash(description, inputs, nodeTemplates, relationshipTemplates, outputs, groups, substitutionMappings, policies);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TopologyTemplate2 {\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n");
sb.append(" nodeTemplates: ").append(toIndentedString(nodeTemplates)).append("\n");
sb.append(" relationshipTemplates: ").append(toIndentedString(relationshipTemplates)).append("\n");
sb.append(" outputs: ").append(toIndentedString(outputs)).append("\n");
sb.append(" groups: ").append(toIndentedString(groups)).append("\n");
sb.append(" substitutionMappings: ").append(toIndentedString(substitutionMappings)).append("\n");
sb.append(" policies: ").append(toIndentedString(policies)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
/**
* Get substitutionMappings
*
* @return substitutionMappings
*
*/
@ApiModelProperty(value = "")
public Map<String, Object> getSubstitutionMappings() {
return substitutionMappings;
}
public void setSubstitutionMappings(Map<String, Object> substitutionMappings) {
this.substitutionMappings = substitutionMappings;
}
public TopologyTemplate policies(List<Map<String, Object>> policies) {
this.policies = policies;
return this;
}
public TopologyTemplate addPoliciesItem(Map<String, Object> policiesItem) {
if (this.policies == null) {
this.policies = new ArrayList<Map<String, Object>>();
}
this.policies.add(policiesItem);
return this;
}
/**
* Get policies
*
* @return policies
*
*/
@ApiModelProperty(value = "")
@Valid
public List<Map<String, Object>> getPolicies() {
return policies;
}
public void setPolicies(List<Map<String, Object>> policies) {
this.policies = policies;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TopologyTemplate topologyTemplate = (TopologyTemplate) o;
return Objects.equals(this.description, topologyTemplate.description)
&& Objects.equals(this.inputs, topologyTemplate.inputs)
&& Objects.equals(this.nodeTemplates, topologyTemplate.nodeTemplates)
&& Objects.equals(this.relationshipTemplates, topologyTemplate.relationshipTemplates)
&& Objects.equals(this.outputs, topologyTemplate.outputs)
&& Objects.equals(this.groups, topologyTemplate.groups)
&& Objects.equals(this.substitutionMappings, topologyTemplate.substitutionMappings)
&& Objects.equals(this.policies, topologyTemplate.policies);
}
@Override
public int hashCode() {
return Objects.hash(description, inputs, nodeTemplates, relationshipTemplates, outputs, groups, substitutionMappings, policies);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TopologyTemplate {\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n");
sb.append(" nodeTemplates: ").append(toIndentedString(nodeTemplates)).append("\n");
sb.append(" relationshipTemplates: ").append(toIndentedString(relationshipTemplates)).append("\n");
sb.append(" outputs: ").append(toIndentedString(outputs)).append("\n");
sb.append(" groups: ").append(toIndentedString(groups)).append("\n");
sb.append(" substitutionMappings: ").append(toIndentedString(substitutionMappings)).append("\n");
sb.append(" policies: ").append(toIndentedString(policies)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
package nl.uva.sne.drip.model; package nl.uva.sne.drip.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -17,13 +16,10 @@ import org.springframework.data.annotation.Id; ...@@ -17,13 +16,10 @@ import org.springframework.data.annotation.Id;
* ToscaTemplate * ToscaTemplate
*/ */
@Validated @Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-06T13:31:49.386Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ToscaTemplate { public class ToscaTemplate {
/**
* @return the id
*/
public String getId() { public String getId() {
return id; return id;
} }
...@@ -117,7 +113,7 @@ public class ToscaTemplate { ...@@ -117,7 +113,7 @@ public class ToscaTemplate {
* Get toscaDefinitionsVersion * Get toscaDefinitionsVersion
* *
* @return toscaDefinitionsVersion * @return toscaDefinitionsVersion
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -138,7 +134,7 @@ public class ToscaTemplate { ...@@ -138,7 +134,7 @@ public class ToscaTemplate {
* Get toscaDefaultNamespace * Get toscaDefaultNamespace
* *
* @return toscaDefaultNamespace * @return toscaDefaultNamespace
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -159,7 +155,7 @@ public class ToscaTemplate { ...@@ -159,7 +155,7 @@ public class ToscaTemplate {
* Get templateName * Get templateName
* *
* @return templateName * @return templateName
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -180,7 +176,7 @@ public class ToscaTemplate { ...@@ -180,7 +176,7 @@ public class ToscaTemplate {
* Get topologyTemplate * Get topologyTemplate
* *
* @return topologyTemplate * @return topologyTemplate
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -203,7 +199,7 @@ public class ToscaTemplate { ...@@ -203,7 +199,7 @@ public class ToscaTemplate {
* Get templateAuthor * Get templateAuthor
* *
* @return templateAuthor * @return templateAuthor
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -224,7 +220,7 @@ public class ToscaTemplate { ...@@ -224,7 +220,7 @@ public class ToscaTemplate {
* Get templateVersion * Get templateVersion
* *
* @return templateVersion * @return templateVersion
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -245,7 +241,7 @@ public class ToscaTemplate { ...@@ -245,7 +241,7 @@ public class ToscaTemplate {
* Get description * Get description
* *
* @return description * @return description
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -274,7 +270,7 @@ public class ToscaTemplate { ...@@ -274,7 +270,7 @@ public class ToscaTemplate {
* Get imports * Get imports
* *
* @return imports * @return imports
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -305,7 +301,7 @@ public class ToscaTemplate { ...@@ -305,7 +301,7 @@ public class ToscaTemplate {
* Get dslDefinitions * Get dslDefinitions
* *
* @return dslDefinitions * @return dslDefinitions
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -334,7 +330,7 @@ public class ToscaTemplate { ...@@ -334,7 +330,7 @@ public class ToscaTemplate {
* Get nodeTypes * Get nodeTypes
* *
* @return nodeTypes * @return nodeTypes
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -363,7 +359,7 @@ public class ToscaTemplate { ...@@ -363,7 +359,7 @@ public class ToscaTemplate {
* Get relationshipTypes * Get relationshipTypes
* *
* @return relationshipTypes * @return relationshipTypes
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -392,7 +388,7 @@ public class ToscaTemplate { ...@@ -392,7 +388,7 @@ public class ToscaTemplate {
* Get relationshipTemplates * Get relationshipTemplates
* *
* @return relationshipTemplates * @return relationshipTemplates
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -421,7 +417,7 @@ public class ToscaTemplate { ...@@ -421,7 +417,7 @@ public class ToscaTemplate {
* Get capabilityTypes * Get capabilityTypes
* *
* @return capabilityTypes * @return capabilityTypes
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -450,7 +446,7 @@ public class ToscaTemplate { ...@@ -450,7 +446,7 @@ public class ToscaTemplate {
* Get artifactTypes * Get artifactTypes
* *
* @return artifactTypes * @return artifactTypes
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -479,7 +475,7 @@ public class ToscaTemplate { ...@@ -479,7 +475,7 @@ public class ToscaTemplate {
* Get dataTypes * Get dataTypes
* *
* @return dataTypes * @return dataTypes
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -508,7 +504,7 @@ public class ToscaTemplate { ...@@ -508,7 +504,7 @@ public class ToscaTemplate {
* Get interfaceTypes * Get interfaceTypes
* *
* @return interfaceTypes * @return interfaceTypes
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -537,7 +533,7 @@ public class ToscaTemplate { ...@@ -537,7 +533,7 @@ public class ToscaTemplate {
* Get policyTypes * Get policyTypes
* *
* @return policyTypes * @return policyTypes
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -566,7 +562,7 @@ public class ToscaTemplate { ...@@ -566,7 +562,7 @@ public class ToscaTemplate {
* Get groupTypes * Get groupTypes
* *
* @return groupTypes * @return groupTypes
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
...@@ -595,7 +591,7 @@ public class ToscaTemplate { ...@@ -595,7 +591,7 @@ public class ToscaTemplate {
* Get repositories * Get repositories
* *
* @return repositories * @return repositories
* *
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
......
package nl.uva.sne.drip.model; package io.swagger.model;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Objects; import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.data.annotation.Id;
/** /**
* User * User
*/ */
@Validated @Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-25T14:09:25.182Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class User {
@JsonProperty("id")
private Long id = null;
@JsonProperty("username")
private String username = null;
@JsonProperty("firstName")
private String firstName = null;
@JsonProperty("lastName")
private String lastName = null;
@JsonProperty("email") public class User {
private String email = null;
@JsonProperty(value = "password", access = Access.WRITE_ONLY)
private String password = null;
@JsonProperty("userStatus")
private Integer userStatus = null;
public User id(Long id) {
this.id = id;
return this;
}
/**
* Get id
*
* @return id
*
*/
@ApiModelProperty(value = "")
public Long getId() { public String getId() {
return id; return id;
} }
public void setId(Long id) {
this.id = id;
}
public User username(String username) {
this.username = username;
return this;
}
/** /**
* Get username * @param id the id to set
*
* @return username
*
*/ */
@ApiModelProperty(value = "") public void setId(String id) {
this.id = id;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get firstName
*
* @return firstName
*
*/
@ApiModelProperty(value = "")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get lastName
*
* @return lastName
*
*/
@ApiModelProperty(value = "")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public User email(String email) {
this.email = email;
return this;
}
/**
* Get email
*
* @return email
*
*/
@ApiModelProperty(value = "")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public User password(String password) {
this.password = password;
return this;
} }
/** @Id
* Get password
*
* @return password
*
*/
@ApiModelProperty(value = "")
@JsonIgnore @JsonIgnore
public String getPassword() { private String id;
return password;
}
public void setPassword(String password) {
this.password = password;
}
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
/**
* User Status
*
* @return userStatus
*
*/
@ApiModelProperty(value = "User Status")
public Integer getUserStatus() {
return userStatus;
}
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
...@@ -193,19 +36,12 @@ public class User { ...@@ -193,19 +36,12 @@ public class User {
if (o == null || getClass() != o.getClass()) { if (o == null || getClass() != o.getClass()) {
return false; return false;
} }
User user = (User) o; return true;
return Objects.equals(this.id, user.id)
&& Objects.equals(this.username, user.username)
&& Objects.equals(this.firstName, user.firstName)
&& Objects.equals(this.lastName, user.lastName)
&& Objects.equals(this.email, user.email)
&& Objects.equals(this.password, user.password)
&& Objects.equals(this.userStatus, user.userStatus);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, username, firstName, lastName, email, password, userStatus); return Objects.hash();
} }
@Override @Override
...@@ -213,13 +49,6 @@ public class User { ...@@ -213,13 +49,6 @@ public class User {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("class User {\n"); sb.append("class User {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n");
sb.append("}"); sb.append("}");
return sb.toString(); return sb.toString();
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
package nl.uva.sne.drip.sure_tosca.client; package nl.uva.sne.drip.sure_tosca.client;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.squareup.okhttp.*; import com.squareup.okhttp.*;
import javax.net.ssl.*; import javax.net.ssl.*;
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* https://github.com/swagger-api/swagger-codegen.git * https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package nl.uva.sne.drip.sure_tosca.client; package nl.uva.sne.drip.sure_tosca.client;
import com.google.gson.Gson; import com.google.gson.Gson;
...@@ -38,6 +36,7 @@ import java.util.Date; ...@@ -38,6 +36,7 @@ import java.util.Date;
import java.util.Map; import java.util.Map;
public class JSON { public class JSON {
private Gson gson; private Gson gson;
private boolean isLenientOnJson = false; private boolean isLenientOnJson = false;
private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
...@@ -47,15 +46,14 @@ public class JSON { ...@@ -47,15 +46,14 @@ public class JSON {
private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
public static GsonBuilder createGson() { public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder() GsonFireBuilder fireBuilder = new GsonFireBuilder();
;
GsonBuilder builder = fireBuilder.createGsonBuilder(); GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder; return builder;
} }
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
JsonElement element = readElement.getAsJsonObject().get(discriminatorField); JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
if(null == element) { if (null == element) {
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
} }
return element.getAsString(); return element.getAsString();
...@@ -63,7 +61,7 @@ public class JSON { ...@@ -63,7 +61,7 @@ public class JSON {
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase());
if(null == clazz) { if (null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
} }
return clazz; return clazz;
...@@ -71,12 +69,12 @@ public class JSON { ...@@ -71,12 +69,12 @@ public class JSON {
public JSON() { public JSON() {
gson = createGson() gson = createGson()
.registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(Date.class, dateTypeAdapter)
.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
.registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
.registerTypeAdapter(byte[].class, byteArrayAdapter) .registerTypeAdapter(byte[].class, byteArrayAdapter)
.create(); .create();
} }
/** /**
...@@ -117,12 +115,11 @@ public class JSON { ...@@ -117,12 +115,11 @@ public class JSON {
/** /**
* Deserialize the given JSON string to Java object. * Deserialize the given JSON string to Java object.
* *
* @param <T> Type * @param <T> Type
* @param body The JSON string * @param body The JSON string
* @param returnType The type to deserialize into * @param returnType The type to deserialize into
* @return The deserialized Java object * @return The deserialized Java object
*/ */
@SuppressWarnings("unchecked")
public <T> T deserialize(String body, Type returnType) { public <T> T deserialize(String body, Type returnType) {
try { try {
if (isLenientOnJson) { if (isLenientOnJson) {
...@@ -136,9 +133,11 @@ public class JSON { ...@@ -136,9 +133,11 @@ public class JSON {
} catch (JsonParseException e) { } catch (JsonParseException e) {
// Fallback processing when failed to parse JSON form response body: // Fallback processing when failed to parse JSON form response body:
// return the response body string directly for the String return type; // return the response body string directly for the String return type;
if (returnType.equals(String.class)) if (returnType.equals(String.class)) {
return (T) body; return (T) body;
else throw (e); } else {
throw (e);
}
} }
} }
...@@ -207,7 +206,7 @@ public class JSON { ...@@ -207,7 +206,7 @@ public class JSON {
default: default:
String date = in.nextString(); String date = in.nextString();
if (date.endsWith("+0000")) { if (date.endsWith("+0000")) {
date = date.substring(0, date.length()-5) + "Z"; date = date.substring(0, date.length() - 5) + "Z";
} }
return OffsetDateTime.parse(date, formatter); return OffsetDateTime.parse(date, formatter);
} }
...@@ -266,9 +265,9 @@ public class JSON { ...@@ -266,9 +265,9 @@ public class JSON {
} }
/** /**
* Gson TypeAdapter for java.sql.Date type * Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used * simple "yyyy-MM-dd" format will be used (more efficient than
* (more efficient than SimpleDateFormat). * SimpleDateFormat).
*/ */
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> { public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
...@@ -321,8 +320,8 @@ public class JSON { ...@@ -321,8 +320,8 @@ public class JSON {
} }
/** /**
* Gson TypeAdapter for java.util.Date type * Gson TypeAdapter for java.util.Date type If the dateFormat is null,
* If the dateFormat is null, ISO8601Utils will be used. * ISO8601Utils will be used.
*/ */
public static class DateTypeAdapter extends TypeAdapter<Date> { public static class DateTypeAdapter extends TypeAdapter<Date> {
......
...@@ -29,6 +29,7 @@ import java.util.ArrayList; ...@@ -29,6 +29,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Set;
import nl.uva.sne.drip.model.NodeTemplate; import nl.uva.sne.drip.model.NodeTemplate;
import nl.uva.sne.drip.model.ToscaTemplate; import nl.uva.sne.drip.model.ToscaTemplate;
import org.junit.After; import org.junit.After;
...@@ -60,10 +61,8 @@ public class ToscaHelperTest { ...@@ -60,10 +61,8 @@ public class ToscaHelperTest {
prop.load(new FileInputStream(resourceName)); prop.load(new FileInputStream(resourceName));
byte[] bytes = Files.readAllBytes(Paths.get(testUpdatedApplicationExampleToscaFilePath)); byte[] bytes = Files.readAllBytes(Paths.get(testUpdatedApplicationExampleToscaFilePath));
String ymlStr = new String(bytes, "UTF-8"); String ymlStr = new String(bytes, "UTF-8");
objectMapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER)); objectMapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER));
toscaTemplate = objectMapper.readValue(ymlStr, ToscaTemplate.class); toscaTemplate = objectMapper.readValue(ymlStr, ToscaTemplate.class);
instance = new ToscaHelper(toscaTemplate, prop.getProperty("sure-tosca.base.path")); instance = new ToscaHelper(toscaTemplate, prop.getProperty("sure-tosca.base.path"));
} }
...@@ -97,9 +96,12 @@ public class ToscaHelperTest { ...@@ -97,9 +96,12 @@ public class ToscaHelperTest {
public void testGetProvisionInterfaceDefinitions() throws Exception { public void testGetProvisionInterfaceDefinitions() throws Exception {
System.out.println("getProvisionInterfaceDefinitions"); System.out.println("getProvisionInterfaceDefinitions");
List<String> toscaInterfaceTypes = new ArrayList<>(); List<String> toscaInterfaceTypes = new ArrayList<>();
toscaInterfaceTypes.add("tosca.interfaces.ARTICONF.CloudsStorm"); String expected = "tosca.interfaces.ARTICONF.CloudsStorm";
toscaInterfaceTypes.add(expected);
List<Map<String, Object>> result = instance.getProvisionInterfaceDefinitions(toscaInterfaceTypes); List<Map<String, Object>> result = instance.getProvisionInterfaceDefinitions(toscaInterfaceTypes);
assertNotNull(result); assertNotNull(result);
String key = result.get(0).keySet().iterator().next();
assertEquals(expected, key);
} }
/** /**
...@@ -110,7 +112,7 @@ public class ToscaHelperTest { ...@@ -110,7 +112,7 @@ public class ToscaHelperTest {
System.out.println("getVMTopologyTemplates"); System.out.println("getVMTopologyTemplates");
List<NodeTemplate> result = instance.getVMTopologyTemplates(); List<NodeTemplate> result = instance.getVMTopologyTemplates();
assertNotNull(result); assertNotNull(result);
for(NodeTemplate nodeTemplate:result){ for (NodeTemplate nodeTemplate : result) {
assertEquals(nodeTemplate.getType(), "tosca.nodes.ARTICONF.VM.topology"); assertEquals(nodeTemplate.getType(), "tosca.nodes.ARTICONF.VM.topology");
} }
} }
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package nl.uva.sne.drip.sure_tosca.client;
import java.io.File;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.assertTrue;
/**
* API tests for DefaultApi
*/
public class DefaultApiTest {
// private final DefaultApi api = new DefaultApi();
/**
*
*
* Recursively get all requirements all the way to the ROOT including the
* input node&#39;s
*
* @throws ApiException if the Api call fails
*/
@Test
public void getAllAncestorPropertiesTest() throws ApiException {
String id = "1";
String nodeName = null;
assertTrue(true);
// List<Map<String, Object>> response = api.getAllAncestorProperties(id, nodeName);
// TODO: test validations
}
// /**
// *
// *
// * Recursively get all requirements all the way to the ROOT including the
// * input node&#39;s
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getAllAncestorTypesTest() throws ApiException {
// String id = null;
// String nodeName = null;
//// List<String> response = api.getAllAncestorTypes(id, nodeName);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * Recursively get all requirements all the way to the ROOT including the
// * input node&#39;s
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getAncestorsRequirementsTest() throws ApiException {
// String id = null;
// String nodeName = null;
//// Map<String, Object> response = api.getAncestorsRequirements(id, nodeName);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * returns the interface types
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getDslDefinitionsTest() throws ApiException {
// String id = null;
// List<String> anchors = null;
// String derivedFrom = null;
//// List<Map<String, Object>> response = api.getDslDefinitions(id, anchors, derivedFrom);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * returns the interface types
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getImportsTest() throws ApiException {
// String id = null;
//// List<Map<String, Object>> response = api.getImports(id);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * s
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getNodeOutputsTest() throws ApiException {
// String id = null;
// String nodeName = null;
//// List<Map<String, Object>> response = api.getNodeOutputs(id, nodeName);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * s
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getNodePropertiesTest() throws ApiException {
// String id = null;
// String nodeName = null;
//// Map<String, Object> response = api.getNodeProperties(id, nodeName);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * Returns the requirements for an input node as described in the template
// * not in the node&#39;s definition
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getNodeRequirementsTest() throws ApiException {
// String id = null;
// String nodeName = null;
//// Map<String, Object> response = api.getNodeRequirements(id, nodeName);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * returns nodes templates in topology
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getNodeTemplatesTest() throws ApiException {
// String id = null;
// String typeName = null;
// String nodeName = null;
// Boolean hasInterfaces = null;
// Boolean hasProperties = null;
// Boolean hasAttributes = null;
// Boolean hasRequirements = null;
// Boolean hasCapabilities = null;
// Boolean hasArtifacts = null;
//// List<NodeTemplate> response = api.getNodeTemplates(id, typeName, nodeName, hasInterfaces, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// *
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getNodeTypeNameTest() throws ApiException {
// String id = null;
// String nodeName = null;
//// String response = api.getNodeTypeName(id, nodeName);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// *
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getParentTypeNameTest() throws ApiException {
// String id = null;
// String nodeName = null;
//// String response = api.getParentTypeName(id, nodeName);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * s
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getRelatedNodesTest() throws ApiException {
// String id = null;
// String nodeName = null;
//// List<NodeTemplate> response = api.getRelatedNodes(id, nodeName);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * returns the interface types
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getRelationshipTemplatesTest() throws ApiException {
// String id = null;
// String typeName = null;
// String derivedFrom = null;
//// List<Map<String, Object>> response = api.getRelationshipTemplates(id, typeName, derivedFrom);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * r
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getTopologyTemplateTest() throws ApiException {
// String id = null;
//// TopologyTemplate response = api.getTopologyTemplate(id);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// *
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getToscaTemplateTest() throws ApiException {
// String id = null;
//// ToscaTemplate response = api.getToscaTemplate(id);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * returns the interface types
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void getTypesTest() throws ApiException {
// String id = null;
// String kindOfType = null;
// Boolean hasInterfaces = null;
// String typeName = null;
// Boolean hasProperties = null;
// Boolean hasAttributes = null;
// Boolean hasRequirements = null;
// Boolean hasCapabilities = null;
// Boolean hasArtifacts = null;
// String derivedFrom = null;
//// List<Map<String, Object>> response = api.getTypes(id, kindOfType, hasInterfaces, typeName, hasProperties, hasAttributes, hasRequirements, hasCapabilities, hasArtifacts, derivedFrom);
//
// // TODO: test validations
// }
//
// /**
// *
// *
// * s
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void setNodePropertiesTest() throws ApiException {
// String id = null;
// Object properties = null;
// String nodeName = null;
//// String response = api.setNodeProperties(id, properties, nodeName);
//
// // TODO: test validations
// }
//
// /**
// * upload a tosca template description file
// *
// * upload and validate a tosca template description file
// *
// * @throws ApiException if the Api call fails
// */
// @Test
// public void uploadToscaTemplateTest() throws ApiException {
// File file = null;
//// String response = api.uploadToscaTemplate(file);
//
// // TODO: test validations
// }
}
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.9.9.3</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
...@@ -52,13 +51,11 @@ ...@@ -52,13 +51,11 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hamcrest</groupId> <groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId> <artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
NodeTemplate: NodeTemplate:
type: "object" type: "object"
properties: properties:
name:
type: "string"
derived_from: derived_from:
type: "string" type: "string"
properties: properties:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment