Skip to content

Commit 2ff8f09

Browse files
Richard Doktoricskeyki
authored andcommitted
RMP-10350 Display cluster create CLI command on the UI
1 parent 26c7239 commit 2ff8f09

File tree

149 files changed

+1006
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1006
-225
lines changed

autoscale/src/main/java/com/sequenceiq/periscope/domain/BaseAlert.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public abstract class BaseAlert {
1919
@Id
2020
@GeneratedValue(strategy = GenerationType.AUTO, generator = "alert_generator")
2121
@SequenceGenerator(name = "alert_generator", sequenceName = "alert_id_seq", allocationSize = 1)
22-
private long id;
22+
private Long id;
2323

2424
private String name;
2525

@@ -28,11 +28,11 @@ public abstract class BaseAlert {
2828
@OneToOne(cascade = CascadeType.ALL, orphanRemoval = true)
2929
private ScalingPolicy scalingPolicy;
3030

31-
public long getId() {
31+
public Long getId() {
3232
return id;
3333
}
3434

35-
public void setId(long id) {
35+
public void setId(Long id) {
3636
this.id = id;
3737
}
3838

autoscale/src/main/java/com/sequenceiq/periscope/domain/ScalingPolicy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ScalingPolicy {
2424
@Id
2525
@GeneratedValue(strategy = GenerationType.AUTO, generator = "policy_generator")
2626
@SequenceGenerator(name = "policy_generator", sequenceName = "scalingpolicy_id_seq", allocationSize = 1)
27-
private long id;
27+
private Long id;
2828

2929
private String name;
3030

@@ -41,11 +41,11 @@ public class ScalingPolicy {
4141
@Column(name = "host_group")
4242
private String hostGroup;
4343

44-
public long getId() {
44+
public Long getId() {
4545
return id;
4646
}
4747

48-
public void setId(long id) {
48+
public void setId(Long id) {
4949
this.id = id;
5050
}
5151

cloud-api/src/main/java/com/sequenceiq/cloudbreak/cloud/model/Image.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,22 @@ public class Image {
2323

2424
private final String imageCatalogUrl;
2525

26-
public Image(String imageName, Map<InstanceGroupType, String> userdata) {
27-
this(imageName, userdata, "", "");
28-
}
26+
private final String imageId;
27+
28+
private final String imageCatalogName;
2929

3030
public Image(@JsonProperty("imageName") String imageName,
3131
@JsonProperty("userdata") Map<InstanceGroupType, String> userdata,
3232
@JsonProperty("osType") String osType,
33-
@JsonProperty("imageCatalogUrl") String imageCatalogUrl) {
33+
@JsonProperty("imageCatalogUrl") String imageCatalogUrl,
34+
@JsonProperty("imageCatalogName") String imageCatalogName,
35+
@JsonProperty("imageId") String imageId) {
3436
this.imageName = imageName;
3537
this.userdata = userdata != null ? ImmutableMap.copyOf(userdata) : null;
3638
this.imageCatalogUrl = imageCatalogUrl;
3739
this.osType = osType;
40+
this.imageCatalogName = imageCatalogName;
41+
this.imageId = imageId;
3842
}
3943

4044
public String getImageName() {
@@ -57,12 +61,22 @@ public String getImageCatalogUrl() {
5761
return imageCatalogUrl;
5862
}
5963

64+
public String getImageId() {
65+
return imageId;
66+
}
67+
68+
public String getImageCatalogName() {
69+
return imageCatalogName;
70+
}
71+
6072
@Override
6173
public String toString() {
6274
return "Image{"
6375
+ "imageName='" + imageName + '\''
6476
+ ", osType='" + osType + '\''
6577
+ ", imageCatalogUrl='" + imageCatalogUrl + '\''
78+
+ ", imageId='" + imageId + '\''
79+
+ ", imageCatalogName='" + imageCatalogName + '\''
6680
+ ", userdata=" + userdata + '}';
6781
}
6882
}

cloud-aws/src/test/java/com/sequenceiq/cloudbreak/cloud/aws/CloudFormationTemplateBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void setUp() throws Exception {
109109
InstanceGroupType.CORE, "CORE",
110110
InstanceGroupType.GATEWAY, "GATEWAY"
111111
);
112-
Image image = new Image("cb-centos66-amb200-2015-05-25", userData);
112+
Image image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "", "default", "default-id");
113113
List<Group> groups = new ArrayList<>();
114114
groups.add(new Group(name, InstanceGroupType.CORE, Collections.singletonList(instance), security, null,
115115
instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey()));

cloud-azure/src/test/java/com/sequenceiq/cloudbreak/cloud/azure/AzureTemplateBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public void setUp() throws Exception {
160160
List<SecurityRule> rules = Collections.singletonList(new SecurityRule("0.0.0.0/0",
161161
new PortDefinition[]{new PortDefinition("22", "22"), new PortDefinition("443", "443")}, "tcp"));
162162
security = new Security(rules, null);
163-
image = new Image("cb-centos66-amb200-2015-05-25", userData);
163+
image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "", "default", "default-id");
164164
cloudContext = new CloudContext(7899L, "thisisaverylongazureresourcenamewhichneedstobeshortened", "dummy1", "dummy2", "test",
165165
Location.location(Region.region("EU"), new AvailabilityZone("availabilityZone")));
166166
azureCredentialView = new AzureCredentialView(cloudCredential("siq-haas"));

cloud-gcp/src/test/java/com/sequenceiq/cloudbreak/cloud/gcp/compute/GcpInstanceResourceBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void setUp() throws Exception {
102102
security = new Security(rules, null);
103103
Location location = Location.location(Region.region("region"), AvailabilityZone.availabilityZone("az"));
104104
Map<InstanceGroupType, String> userData = ImmutableMap.of(InstanceGroupType.CORE, "CORE", InstanceGroupType.GATEWAY, "GATEWAY");
105-
image = new Image("cb-centos66-amb200-2015-05-25", userData);
105+
image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "", "default", "default-id");
106106
CloudContext cloudContext = new CloudContext(privateId, "testname", "GCP", "owner");
107107
CloudCredential cloudCredential = new CloudCredential(privateId, "credentialname");
108108
cloudCredential.putParameter("projectId", "projectId");

cloud-openstack/src/test/java/com/sequenceiq/cloudbreak/cloud/openstack/heat/HeatTemplateBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void setup() throws IOException, TemplateException {
117117
InstanceGroupType.CORE, "CORE",
118118
InstanceGroupType.GATEWAY, "GATEWAY"
119119
);
120-
image = new Image("cb-centos66-amb200-2015-05-25", userData);
120+
image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "url", "default", null);
121121
}
122122

123123
@Test

cloud-reactor/src/test/java/com/sequenceiq/cloudbreak/cloud/handler/ParameterGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public CloudStack createCloudStack() {
8080
InstanceGroupType.CORE, "CORE",
8181
InstanceGroupType.GATEWAY, "GATEWAY"
8282
);
83-
Image image = new Image("cb-centos66-amb200-2015-05-25", userData);
83+
Image image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "", "default", "default-id");
8484

8585
Subnet subnet = new Subnet("10.0.0.0/24");
8686
Network network = new Network(subnet);

core-api/src/main/java/com/sequenceiq/cloudbreak/api/endpoint/v1/ClusterTemplateEndpoint.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import com.sequenceiq.cloudbreak.api.model.ClusterTemplateRequest;
1515
import com.sequenceiq.cloudbreak.api.model.ClusterTemplateResponse;
16+
import com.sequenceiq.cloudbreak.api.model.v2.StackV2Request;
1617
import com.sequenceiq.cloudbreak.doc.ContentType;
1718
import com.sequenceiq.cloudbreak.doc.ControllerDescription;
1819
import com.sequenceiq.cloudbreak.doc.Notes;
@@ -33,6 +34,13 @@ public interface ClusterTemplateEndpoint {
3334
nickname = "getClusterTemplate")
3435
ClusterTemplateResponse get(@PathParam("id") Long id);
3536

37+
@GET
38+
@Path("cluster/user/{name}")
39+
@Produces(MediaType.APPLICATION_JSON)
40+
@ApiOperation(value = ClusterTemplateOpDescription.GET_BY_CLUSTER_NAME, produces = ContentType.JSON, notes = Notes.CLUSTER_TEMPLATE_NOTES,
41+
nickname = "getClusterTemplateFromClusterName")
42+
StackV2Request fromClusterName(@PathParam("name") String name);
43+
3644
@DELETE
3745
@Path("{id}")
3846
@Produces(MediaType.APPLICATION_JSON)

core-api/src/main/java/com/sequenceiq/cloudbreak/api/model/AmbariDatabaseDetailsJson.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
import javax.validation.constraints.Pattern;
1212

1313
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
14+
import com.fasterxml.jackson.annotation.JsonInclude;
1415

1516
import io.swagger.annotations.ApiModel;
1617
import io.swagger.annotations.ApiModelProperty;
1718

1819
@ApiModel("AmbariDatabaseDetails")
1920
@JsonIgnoreProperties(ignoreUnknown = true)
21+
@JsonInclude(JsonInclude.Include.NON_NULL)
2022
public class AmbariDatabaseDetailsJson implements JsonEntity {
2123

2224
@NotNull

0 commit comments

Comments
 (0)