Commit 8d9282a9 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added credential type

parent 8749ae26
package nl.uva.sne.drip.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* NodeTemplate
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-09T16:44:17.416Z")
public class NodeTemplate {
@JsonProperty("name")
private String name = null;
@JsonProperty("type")
private String type = null;
@JsonProperty("requirements")
@Valid
private List<Map<String, String>> requirements = null;
@JsonProperty("artifacts")
@Valid
private Map<String, String> artifacts = null;
@JsonProperty("properties")
@Valid
private Map<String, String> properties = null;
@JsonProperty("interfaces")
@Valid
private Map<String, String> interfaces = null;
@JsonProperty("capabilities")
@Valid
private Map<String, String> capabilities = null;
@JsonProperty("workflows")
@Valid
private Map<String, String> workflows = null;
public NodeTemplate 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 NodeTemplate type(String type) {
this.type = type;
return this;
}
/**
* Get type
* @return type
**/
@ApiModelProperty(value = "")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public NodeTemplate requirements(List<Map<String, String>> requirements) {
this.requirements = requirements;
return this;
}
public NodeTemplate addRequirementsItem(Map<String, String> requirementsItem) {
if (this.requirements == null) {
this.requirements = new ArrayList<Map<String, String>>();
}
this.requirements.add(requirementsItem);
return this;
}
/**
* Get requirements
* @return requirements
**/
@ApiModelProperty(value = "")
@Valid
public List<Map<String, String>> getRequirements() {
return requirements;
}
public void setRequirements(List<Map<String, String>> requirements) {
this.requirements = requirements;
}
public NodeTemplate artifacts(Map<String, String> artifacts) {
this.artifacts = artifacts;
return this;
}
public NodeTemplate putArtifactsItem(String key, String artifactsItem) {
if (this.artifacts == null) {
this.artifacts = new HashMap<String, String>();
}
this.artifacts.put(key, artifactsItem);
return this;
}
/**
* Get artifacts
* @return artifacts
**/
@ApiModelProperty(value = "")
public Map<String, String> getArtifacts() {
return artifacts;
}
public void setArtifacts(Map<String, String> artifacts) {
this.artifacts = artifacts;
}
public NodeTemplate properties(Map<String, String> properties) {
this.properties = properties;
return this;
}
public NodeTemplate putPropertiesItem(String key, String propertiesItem) {
if (this.properties == null) {
this.properties = new HashMap<String, String>();
}
this.properties.put(key, propertiesItem);
return this;
}
/**
* Get properties
* @return properties
**/
@ApiModelProperty(value = "")
public Map<String, String> getProperties() {
return properties;
}
public void setProperties(Map<String, String> properties) {
this.properties = properties;
}
public NodeTemplate interfaces(Map<String, String> interfaces) {
this.interfaces = interfaces;
return this;
}
public NodeTemplate putInterfacesItem(String key, String interfacesItem) {
if (this.interfaces == null) {
this.interfaces = new HashMap<String, String>();
}
this.interfaces.put(key, interfacesItem);
return this;
}
/**
* Get interfaces
* @return interfaces
**/
@ApiModelProperty(value = "")
public Map<String, String> getInterfaces() {
return interfaces;
}
public void setInterfaces(Map<String, String> interfaces) {
this.interfaces = interfaces;
}
public NodeTemplate capabilities(Map<String, String> capabilities) {
this.capabilities = capabilities;
return this;
}
public NodeTemplate putCapabilitiesItem(String key, String capabilitiesItem) {
if (this.capabilities == null) {
this.capabilities = new HashMap<String, String>();
}
this.capabilities.put(key, capabilitiesItem);
return this;
}
/**
* Get capabilities
* @return capabilities
**/
@ApiModelProperty(value = "")
public Map<String, String> getCapabilities() {
return capabilities;
}
public void setCapabilities(Map<String, String> capabilities) {
this.capabilities = capabilities;
}
public NodeTemplate workflows(Map<String, String> workflows) {
this.workflows = workflows;
return this;
}
public NodeTemplate putWorkflowsItem(String key, String workflowsItem) {
if (this.workflows == null) {
this.workflows = new HashMap<String, String>();
}
this.workflows.put(key, workflowsItem);
return this;
}
/**
* Get workflows
* @return workflows
**/
@ApiModelProperty(value = "")
public Map<String, String> getWorkflows() {
return workflows;
}
public void setWorkflows(Map<String, String> workflows) {
this.workflows = workflows;
}
@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.name, nodeTemplate.name) &&
Objects.equals(this.type, nodeTemplate.type) &&
Objects.equals(this.requirements, nodeTemplate.requirements) &&
Objects.equals(this.artifacts, nodeTemplate.artifacts) &&
Objects.equals(this.properties, nodeTemplate.properties) &&
Objects.equals(this.interfaces, nodeTemplate.interfaces) &&
Objects.equals(this.capabilities, nodeTemplate.capabilities) &&
Objects.equals(this.workflows, nodeTemplate.workflows);
}
@Override
public int hashCode() {
return Objects.hash(name, type, requirements, artifacts, properties, interfaces, capabilities, workflows);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class NodeTemplate {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" requirements: ").append(toIndentedString(requirements)).append("\n");
sb.append(" artifacts: ").append(toIndentedString(artifacts)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append(" interfaces: ").append(toIndentedString(interfaces)).append("\n");
sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n");
sb.append(" workflows: ").append(toIndentedString(workflows)).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;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* TopologyTemplate
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-09T16:44:17.416Z")
public class TopologyTemplate {
@JsonProperty("description")
private String description = null;
@JsonProperty("inputs")
@Valid
private List<Map<String, String>> inputs = null;
@JsonProperty("policies")
@Valid
private List<Map<String, String>> policies = null;
@JsonProperty("outputs")
@Valid
private List<Map<String, String>> outputs = null;
@JsonProperty("node_templates")
private NodeTemplate nodeTemplates = null;
@JsonProperty("relationship_templates")
@Valid
private Map<String, String> relationshipTemplates = null;
@JsonProperty("groups")
@Valid
private Map<String, String> groups = null;
@JsonProperty("substitution_mappings")
@Valid
private Map<String, String> substitutionMappings = null;
public TopologyTemplate description(String description) {
this.description = description;
return this;
}
/**
* Get description
* @return description
**/
@ApiModelProperty(value = "")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public TopologyTemplate inputs(List<Map<String, String>> inputs) {
this.inputs = inputs;
return this;
}
public TopologyTemplate addInputsItem(Map<String, String> inputsItem) {
if (this.inputs == null) {
this.inputs = new ArrayList<Map<String, String>>();
}
this.inputs.add(inputsItem);
return this;
}
/**
* Get inputs
* @return inputs
**/
@ApiModelProperty(value = "")
@Valid
public List<Map<String, String>> getInputs() {
return inputs;
}
public void setInputs(List<Map<String, String>> inputs) {
this.inputs = inputs;
}
public TopologyTemplate policies(List<Map<String, String>> policies) {
this.policies = policies;
return this;
}
public TopologyTemplate addPoliciesItem(Map<String, String> policiesItem) {
if (this.policies == null) {
this.policies = new ArrayList<Map<String, String>>();
}
this.policies.add(policiesItem);
return this;
}
/**
* Get policies
* @return policies
**/
@ApiModelProperty(value = "")
@Valid
public List<Map<String, String>> getPolicies() {
return policies;
}
public void setPolicies(List<Map<String, String>> policies) {
this.policies = policies;
}
public TopologyTemplate outputs(List<Map<String, String>> outputs) {
this.outputs = outputs;
return this;
}
public TopologyTemplate addOutputsItem(Map<String, String> outputsItem) {
if (this.outputs == null) {
this.outputs = new ArrayList<Map<String, String>>();
}
this.outputs.add(outputsItem);
return this;
}
/**
* Get outputs
* @return outputs
**/
@ApiModelProperty(value = "")
@Valid
public List<Map<String, String>> getOutputs() {
return outputs;
}
public void setOutputs(List<Map<String, String>> outputs) {
this.outputs = outputs;
}
public TopologyTemplate nodeTemplates(NodeTemplate nodeTemplates) {
this.nodeTemplates = nodeTemplates;
return this;
}
/**
* Get nodeTemplates
* @return nodeTemplates
**/
@ApiModelProperty(value = "")
@Valid
public NodeTemplate getNodeTemplates() {
return nodeTemplates;
}
public void setNodeTemplates(NodeTemplate nodeTemplates) {
this.nodeTemplates = nodeTemplates;
}
public TopologyTemplate relationshipTemplates(Map<String, String> relationshipTemplates) {
this.relationshipTemplates = relationshipTemplates;
return this;
}
public TopologyTemplate putRelationshipTemplatesItem(String key, String relationshipTemplatesItem) {
if (this.relationshipTemplates == null) {
this.relationshipTemplates = new HashMap<String, String>();
}
this.relationshipTemplates.put(key, relationshipTemplatesItem);
return this;
}
/**
* Get relationshipTemplates
* @return relationshipTemplates
**/
@ApiModelProperty(value = "")
public Map<String, String> getRelationshipTemplates() {
return relationshipTemplates;
}
public void setRelationshipTemplates(Map<String, String> relationshipTemplates) {
this.relationshipTemplates = relationshipTemplates;
}
public TopologyTemplate groups(Map<String, String> groups) {
this.groups = groups;
return this;
}
public TopologyTemplate putGroupsItem(String key, String groupsItem) {
if (this.groups == null) {
this.groups = new HashMap<String, String>();
}
this.groups.put(key, groupsItem);
return this;
}
/**
* Get groups
* @return groups
**/
@ApiModelProperty(value = "")
public Map<String, String> getGroups() {
return groups;
}
public void setGroups(Map<String, String> groups) {
this.groups = groups;
}
public TopologyTemplate substitutionMappings(Map<String, String> substitutionMappings) {
this.substitutionMappings = substitutionMappings;
return this;
}
public TopologyTemplate putSubstitutionMappingsItem(String key, String substitutionMappingsItem) {
if (this.substitutionMappings == null) {
this.substitutionMappings = new HashMap<String, String>();
}
this.substitutionMappings.put(key, substitutionMappingsItem);
return this;
}
/**
* Get substitutionMappings
* @return substitutionMappings
**/
@ApiModelProperty(value = "")
public Map<String, String> getSubstitutionMappings() {
return substitutionMappings;
}
public void setSubstitutionMappings(Map<String, String> substitutionMappings) {
this.substitutionMappings = substitutionMappings;
}
@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.policies, topologyTemplate.policies) &&
Objects.equals(this.outputs, topologyTemplate.outputs) &&
Objects.equals(this.nodeTemplates, topologyTemplate.nodeTemplates) &&
Objects.equals(this.relationshipTemplates, topologyTemplate.relationshipTemplates) &&
Objects.equals(this.groups, topologyTemplate.groups) &&
Objects.equals(this.substitutionMappings, topologyTemplate.substitutionMappings);
}
@Override
public int hashCode() {
return Objects.hash(description, inputs, policies, outputs, nodeTemplates, relationshipTemplates, groups, substitutionMappings);
}
@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(" policies: ").append(toIndentedString(policies)).append("\n");
sb.append(" outputs: ").append(toIndentedString(outputs)).append("\n");
sb.append(" nodeTemplates: ").append(toIndentedString(nodeTemplates)).append("\n");
sb.append(" relationshipTemplates: ").append(toIndentedString(relationshipTemplates)).append("\n");
sb.append(" groups: ").append(toIndentedString(groups)).append("\n");
sb.append(" substitutionMappings: ").append(toIndentedString(substitutionMappings)).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 ");
}
}
...@@ -13,10 +13,9 @@ import javax.validation.constraints.*; ...@@ -13,10 +13,9 @@ import javax.validation.constraints.*;
* User * User
*/ */
@Validated @Validated
@javax.annotation.Generated(value = "nl.uva.sne.drip.codegen.languages.SpringCodegen", date = "2019-10-09T14:00:37.436Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-09T16:44:17.416Z")
public class User { public class User {
@JsonProperty("id") @JsonProperty("id")
private Long id = null; private Long id = null;
...@@ -45,12 +44,11 @@ public class User { ...@@ -45,12 +44,11 @@ public class User {
/** /**
* Get id * Get id
*
* @return id * @return id
* **/
*/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -66,12 +64,11 @@ public class User { ...@@ -66,12 +64,11 @@ public class User {
/** /**
* Get username * Get username
*
* @return username * @return username
* **/
*/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public String getUsername() { public String getUsername() {
return username; return username;
} }
...@@ -87,12 +84,11 @@ public class User { ...@@ -87,12 +84,11 @@ public class User {
/** /**
* Get firstName * Get firstName
*
* @return firstName * @return firstName
* **/
*/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public String getFirstName() { public String getFirstName() {
return firstName; return firstName;
} }
...@@ -108,12 +104,11 @@ public class User { ...@@ -108,12 +104,11 @@ public class User {
/** /**
* Get lastName * Get lastName
*
* @return lastName * @return lastName
* **/
*/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public String getLastName() { public String getLastName() {
return lastName; return lastName;
} }
...@@ -129,12 +124,11 @@ public class User { ...@@ -129,12 +124,11 @@ public class User {
/** /**
* Get email * Get email
*
* @return email * @return email
* **/
*/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public String getEmail() { public String getEmail() {
return email; return email;
} }
...@@ -150,12 +144,11 @@ public class User { ...@@ -150,12 +144,11 @@ public class User {
/** /**
* Get password * Get password
*
* @return password * @return password
* **/
*/
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
public String getPassword() { public String getPassword() {
return password; return password;
} }
...@@ -171,12 +164,11 @@ public class User { ...@@ -171,12 +164,11 @@ public class User {
/** /**
* User Status * User Status
*
* @return userStatus * @return userStatus
* **/
*/
@ApiModelProperty(value = "User Status") @ApiModelProperty(value = "User Status")
public Integer getUserStatus() { public Integer getUserStatus() {
return userStatus; return userStatus;
} }
...@@ -185,6 +177,7 @@ public class User { ...@@ -185,6 +177,7 @@ public class User {
this.userStatus = userStatus; this.userStatus = userStatus;
} }
@Override @Override
public boolean equals(java.lang.Object o) { public boolean equals(java.lang.Object o) {
if (this == o) { if (this == o) {
...@@ -194,13 +187,13 @@ public class User { ...@@ -194,13 +187,13 @@ public class User {
return false; return false;
} }
User user = (User) o; User user = (User) o;
return Objects.equals(this.id, user.id) return Objects.equals(this.id, user.id) &&
&& Objects.equals(this.username, user.username) Objects.equals(this.username, user.username) &&
&& Objects.equals(this.firstName, user.firstName) Objects.equals(this.firstName, user.firstName) &&
&& Objects.equals(this.lastName, user.lastName) Objects.equals(this.lastName, user.lastName) &&
&& Objects.equals(this.email, user.email) Objects.equals(this.email, user.email) &&
&& Objects.equals(this.password, user.password) Objects.equals(this.password, user.password) &&
&& Objects.equals(this.userStatus, user.userStatus); Objects.equals(this.userStatus, user.userStatus);
} }
@Override @Override
...@@ -235,3 +228,4 @@ public class User { ...@@ -235,3 +228,4 @@ public class User {
return o.toString().replace("\n", "\n "); return o.toString().replace("\n", "\n ");
} }
} }
...@@ -116,6 +116,189 @@ paths: ...@@ -116,6 +116,189 @@ paths:
- drip_auth: - drip_auth:
- "write:ToscaTemplate" - "write:ToscaTemplate"
- "read:ToscaTemplate" - "read:ToscaTemplate"
/planner/plan/{id}:
get:
summary: "plan tosca template"
description: "Returns the ID of the planed topolog template"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template to plan"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/planner/{id}:
get:
summary: "get the plan tosca template"
description: "Returns the plan topolog template"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template plan"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/provisioner/provision/{id}:
get:
summary: "provision tosca template"
description: "Returns the provision ID"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template to plan"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/provisioner/{id}:
get:
summary: "the provisioned tosca template"
description: "Returns the provisioned tosca template"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template to plan"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/deployer/deploy/{id}:
get:
summary: "deploy the software tosca template"
description: "Returns the deployment ID"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template to deploy"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/deployer/{id}:
get:
summary: "get the deployment topolog template"
description: "Returns the deployment topolog template"
produces:
- "text/plain"
parameters:
- name: "id"
in: "path"
description: "ID of topolog template to deploy"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "write:ToscaTemplate"
- "read:ToscaTemplate"
/credential:
post:
summary: "Create credentials"
description: "Creates credentials"
produces:
- "application/json"
consumes:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Created user object"
required: true
schema:
$ref: "#/definitions/Credentials"
responses:
200:
description: "successful operation"
400:
description: "Invalid ID supplied"
404:
description: "ToscaTemplate not found"
405:
description: "Invalid input"
security:
- drip_auth:
- "admin:User"
/user: /user:
post: post:
summary: "Create user" summary: "Create user"
...@@ -427,7 +610,23 @@ definitions: ...@@ -427,7 +610,23 @@ definitions:
type: object type: object
additionalProperties: additionalProperties:
type: string type: string
Credentials:
type: "object"
properties:
protocol:
type: "string"
token_type:
type: "string"
token:
type: "string"
keys:
type: object
additionalProperties:
type: string
user:
type: "string"
cloud_provider_name:
type: "string"
externalDocs: externalDocs:
description: "Find out more about DRIP" description: "Find out more about DRIP"
url: "https://github.com/QCAPI-DRIP/DRIP-integration/wiki" url: "https://github.com/QCAPI-DRIP/DRIP-integration/wiki"
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