|
|
@@ -2664,35 +2664,37 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
};
|
|
|
|
|
|
self.createCluster = function() {
|
|
|
- $.post("/metadata/api/dataeng/create_cluster/", {
|
|
|
- "cluster_name": "cluster_name",
|
|
|
- "cdh_version": "CDH515",
|
|
|
- "public_key": "public_key",
|
|
|
- "instance_type": "m4.xlarge",
|
|
|
- "environment_name": "crn:altus:environments:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:environment:analytics/236ebdda-18bd-428a-9d2b-cd6973d42946",
|
|
|
- "workers_group_size": "3",
|
|
|
- "namespace_name": "crn:altus:sdx:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:namespace:analytics/7ea35fe5-dbc9-4b17-92b1-97a1ab32e410"
|
|
|
- }, function(data) {
|
|
|
- console.log(ko.mapping.toJSON(data));
|
|
|
- $(document).trigger("info", ko.mapping.toJSON(data));
|
|
|
- self.updateJobs();
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- self.createDataWarehouseCluster = function() {
|
|
|
- $.post("/metadata/api/analytic_db/create_cluster/", {
|
|
|
- "cluster_name": "cluster_name",
|
|
|
- "cdh_version": "CDH515",
|
|
|
- "public_key": "public_key",
|
|
|
- "instance_type": "m4.xlarge",
|
|
|
- "environment_name": "crn:altus:environments:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:environment:jheyming-secure/b4e6d99a-261f-4ada-9b4a-576aa0af8979",
|
|
|
- "workers_group_size": "3",
|
|
|
- "namespace_name": "crn:altus:sdx:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:namespace:analytics/7ea35fe5-dbc9-4b17-92b1-97a1ab32e410"
|
|
|
- }, function(data) {
|
|
|
- console.log(ko.mapping.toJSON(data));
|
|
|
- $(document).trigger("info", ko.mapping.toJSON(data));
|
|
|
- self.updateJobs();
|
|
|
- });
|
|
|
+ if (self.interface().indexOf('dataeng') != -1) {
|
|
|
+ $.post("/metadata/api/dataeng/create_cluster/", {
|
|
|
+ "cluster_name": "cluster_name",
|
|
|
+ "cdh_version": "CDH515",
|
|
|
+ "public_key": "public_key",
|
|
|
+ "instance_type": "m4.xlarge",
|
|
|
+ "environment_name": "crn:altus:environments:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:environment:analytics/236ebdda-18bd-428a-9d2b-cd6973d42946",
|
|
|
+ "workers_group_size": "3",
|
|
|
+ "namespace_name": "crn:altus:sdx:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:namespace:analytics/7ea35fe5-dbc9-4b17-92b1-97a1ab32e410"
|
|
|
+ }, function(data) {
|
|
|
+ console.log(ko.mapping.toJSON(data));
|
|
|
+ $(document).trigger("info", ko.mapping.toJSON(data));
|
|
|
+ self.updateJobs();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ self.createDataWarehouseCluster = function() {
|
|
|
+ $.post("/metadata/api/analytic_db/create_cluster/", {
|
|
|
+ "cluster_name": "cluster_name",
|
|
|
+ "cdh_version": "CDH515",
|
|
|
+ "public_key": "public_key",
|
|
|
+ "instance_type": "m4.xlarge",
|
|
|
+ "environment_name": "crn:altus:environments:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:environment:jheyming-secure/b4e6d99a-261f-4ada-9b4a-576aa0af8979",
|
|
|
+ "workers_group_size": "3",
|
|
|
+ "namespace_name": "crn:altus:sdx:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:namespace:analytics/7ea35fe5-dbc9-4b17-92b1-97a1ab32e410"
|
|
|
+ }, function(data) {
|
|
|
+ console.log(ko.mapping.toJSON(data));
|
|
|
+ $(document).trigger("info", ko.mapping.toJSON(data));
|
|
|
+ self.updateJobs();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
self.control = function (action) {
|
|
|
@@ -2764,8 +2766,16 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
self.clusterType = ko.observable();
|
|
|
self.isMini = ko.observable(false);
|
|
|
|
|
|
+ self.availableComputes = ko.observableArray();
|
|
|
+ self.availableComputes.subscribe(function(newValue) {
|
|
|
+ if (newValue.length > 0 && !self.compute()) {
|
|
|
+ self.compute(self.availableComputes()[0]);
|
|
|
+ }
|
|
|
+ });
|
|
|
self.compute = ko.observable();
|
|
|
|
|
|
+ ContextCatalog.getComputes({ sourceType: 'jobs' }).done(self.availableComputes);
|
|
|
+
|
|
|
self.availableInterfaces = ko.pureComputed(function () {
|
|
|
var jobsInterfaceCondition = function () {
|
|
|
return self.appConfig() && self.appConfig()['browser'] && self.appConfig()['browser']['interpreter_names'].indexOf('yarn') != -1 && self.clusterType() != '${ ANALYTIC_DB }' && (!self.compute() || self.compute()['type'].indexOf('altus') == -1);
|