75f97ee54fb819e1ec32cb849e9436d1f5a5e79b
[ccsdk/dashboard.git] /
1 package org.onap.ccsdk.dashboard.model.deploymenthandler;
2
3 import java.util.Map;
4 import java.util.Optional;
5
6 import com.fasterxml.jackson.annotation.JsonCreator;
7 import com.fasterxml.jackson.annotation.JsonProperty;
8
9 /**
10  * Model for message POST-ed to controller to create a Deployment via the Deployment Handler API:
11  * 
12  * <pre>
13         { 
14                 "component" : "comp",
15                 "deploymentTag" : "tag",
16                 "blueprintName" : "name",
17                 "blueprintVersion" : "version",
18                 "blueprintId" : "bp_id",
19                 "inputs" :
20                         {
21                                 "input1" : "parameter1",
22                                 "input2" : "parameter2",
23                                                 ...
24                                 "inputn" : "parametern"
25                         },
26                 "tenant" : "tenant_name"        
27         }
28  * </pre>
29  * 
30  * THIS OBJECT INCLUDES THE DEPLOYMENTID CREATED BY THE USER!
31  */
32 public class DeploymentInput {
33         
34         /** component or namespace for the service */
35         private final String component;
36         
37         /** tag to identify the deployment */
38         private final String tag;
39         
40         /** The blueprint name for the service to be deployed. */
41         private final String blueprintName;
42         
43         /** blueprint version for the service to be deployed */
44         private final Optional<Integer> blueprintVersion;
45         
46         /** blueprint typeId from inventory */
47         private final Optional<String> blueprintId;
48         
49         /** The cloudify tenant name for the deployment */
50         private final String tenant;
51         /** 
52          * Object containing inputs needed by the service blueprint to create an instance of the service.
53          * Content of the object depends on the service being deployed.
54          */
55         private final Map<String, Object> inputs;
56         
57         @JsonCreator
58         public DeploymentInput(
59                         @JsonProperty("component") String component,
60                         @JsonProperty("tag") String tag,
61                         @JsonProperty("blueprintName") String blueprintName,
62                         @JsonProperty("blueprintVersion") Integer blueprintVersion,
63                         @JsonProperty("blueprintId") String blueprintId,
64                         @JsonProperty("inputs") Map<String, Object> inputs,
65                         @JsonProperty("tenant") String tenant) {
66                 this.component = component;
67                 this.tag = tag;
68                 this.blueprintName = blueprintName;
69                 this.blueprintVersion = Optional.ofNullable(blueprintVersion);
70                 this.blueprintId = Optional.ofNullable(blueprintId);
71                 this.inputs = inputs;
72                 this.tenant = tenant;
73         }
74         
75         public String getBlueprintName() {
76                 return this.blueprintName;
77         }
78         
79         public Map<String, Object> getInputs() {
80                 return this.inputs;
81         }
82         
83         public String getTenant() {
84                 return this.tenant;
85         }
86
87         public Optional<Integer> getBlueprintVersion() {
88                 return blueprintVersion;
89         }
90
91         public String getTag() {
92                 return tag;
93         }
94
95         public String getComponent() {
96                 return component;
97         }
98
99         public Optional<String> getBlueprintId() {
100                 return blueprintId;
101         }
102 }