|
@@ -31,23 +31,23 @@ var App = require('app');
|
|
|
*/
|
|
|
var urls = {
|
|
|
'background_operations': {
|
|
|
- 'mock': '/data/background_operations/list_on_start.json',
|
|
|
'real': '/clusters/{clusterName}/requests/?fields=tasks/*',
|
|
|
+ 'mock': '/data/background_operations/list_on_start.json',
|
|
|
'testInProduction': true
|
|
|
},
|
|
|
'background_operations.update_task': {
|
|
|
- 'mock': '/data/background_operations/one_task.json',
|
|
|
'real': '/clusters/{clusterName}/requests/{requestId}/tasks/{taskId}',
|
|
|
+ 'mock': '/data/background_operations/one_task.json',
|
|
|
'testInProduction': true
|
|
|
},
|
|
|
'background_operations.get_most_recent': {
|
|
|
- 'mock': '/data/background_operations/list_on_start.json',
|
|
|
'real': '/clusters/{clusterName}/requests?fields=*,tasks/Tasks/*',
|
|
|
+ 'mock': '/data/background_operations/list_on_start.json',
|
|
|
'testInProduction': true
|
|
|
},
|
|
|
'service.item.start_stop': {
|
|
|
- 'mock': '/data/wizard/deploy/poll_1.json',
|
|
|
'real': '/clusters/{clusterName}/services/{serviceName}',
|
|
|
+ 'mock': '/data/wizard/deploy/poll_1.json',
|
|
|
'format': function (data, opt) {
|
|
|
return {
|
|
|
type: 'PUT',
|
|
@@ -65,8 +65,8 @@ var urls = {
|
|
|
}
|
|
|
},
|
|
|
'service.item.smoke': {
|
|
|
- 'mock': '/data/wizard/deploy/poll_1.json',
|
|
|
'real': '/clusters/{clusterName}/services/{serviceName}/actions/{serviceName}_SERVICE_CHECK',
|
|
|
+ 'mock': '/data/wizard/deploy/poll_1.json',
|
|
|
'format': function () {
|
|
|
return {
|
|
|
'type': 'POST',
|
|
@@ -174,6 +174,7 @@ var urls = {
|
|
|
'reassign.get_logs': {
|
|
|
'real': '/clusters/{clusterName}/requests/{requestId}?fields=tasks/*',
|
|
|
'type': 'GET'
|
|
|
+
|
|
|
},
|
|
|
'reassign.create_configs': {
|
|
|
'real': '/clusters/{clusterName}/configurations',
|
|
@@ -237,6 +238,429 @@ var urls = {
|
|
|
async: false
|
|
|
};
|
|
|
}
|
|
|
+ },
|
|
|
+ 'service.metrics.hbase.cluster_requests': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/cluster_requests[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hbase/cluster_requests.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hbase.hlog_split_size': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/splitSize_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hbase/hlog_split_size.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hbase.hlog_split_time': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/splitTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hbase/hlog_split_time.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hbase.regionserver_queuesize': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/flushQueueSize[{fromSeconds},{toSeconds},{stepSeconds}],metrics/hbase/regionserver/compactionQueueSize[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hbase/regionserver_queuesize.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hbase.regionserver_regions': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/regions[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hbase/regionserver_regions.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hbase.regionserver_rw_requests': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/readRequestsCount[{fromSeconds},{toSeconds},{stepSeconds}],metrics/hbase/regionserver/writeRequestsCount[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hbase/regionserver_rw_requests.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.mapreduce.gc': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{jobTrackerNode}/host_components/JOBTRACKER?fields=metrics/jvm/gcTimeMillis[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/mapreduce/gc.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.mapreduce.jobs_status': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/jobs_completed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_preparing[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_failed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_submitted[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_failed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_running[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/mapreduce/jobs_status.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.mapreduce.jobs_heap': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{jobTrackerNode}/host_components/JOBTRACKER?fields=metrics/jvm/memNonHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memNonHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/mapreduce/jvm_heap.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.mapreduce.jobs_threads': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{jobTrackerNode}/host_components/JOBTRACKER?fields=metrics/jvm/threadsRunnable[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsBlocked[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsWaiting[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsTimedWaiting[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/mapreduce/jvm_threads.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.mapreduce.map_slots': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/occupied_map_slots[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/reserved_map_slots[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/mapreduce/map_slots.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.mapreduce.reduce_slots': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/occupied_reduce_slots[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/reserved_reduce_slots[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/mapreduce/reduce_slots.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.mapreduce.rpc': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{jobTrackerNode}/host_components/JOBTRACKER?fields=metrics/rpc/RpcQueueTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/mapreduce/rpc.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.mapreduce.tasks_running_waiting': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/running_maps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/running_reduces[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/waiting_maps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/waiting_reduces[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/mapreduce/tasks_running_waiting.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hdfs.block_status': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{nameNodeName}/host_components/NAMENODE?fields=metrics/dfs/FSNamesystem/PendingReplicationBlocks[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/UnderReplicatedBlocks[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hdfs/block_status.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hdfs.file_operations': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{nameNodeName}/host_components/NAMENODE?fields=metrics/dfs/namenode/FileInfoOps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/namenode/CreateFileOps[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hdfs/file_operations.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hdfs.gc': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{nameNodeName}/host_components/NAMENODE?fields=metrics/jvm/gcTimeMillis[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hdfs/gc.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hdfs.io': {
|
|
|
+ 'real': '/clusters/{clusterName}/services/HDFS/components/DATANODE?fields=metrics/dfs/datanode/bytes_written[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/datanode/bytes_read[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hdfs/io.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hdfs.jvm_heap': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{nameNodeName}/host_components/NAMENODE?fields=metrics/jvm/memNonHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memNonHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hdfs/jvm_heap.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hdfs.jvm_threads': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{nameNodeName}/host_components/NAMENODE?fields=metrics/jvm/threadsRunnable[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsBlocked[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsWaiting[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsTimedWaiting[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hdfs/jvm_threads.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hdfs.rpc': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{nameNodeName}/host_components/NAMENODE?fields=metrics/rpc/RpcQueueTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hdfs/rpc.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'service.metrics.hdfs.space_utilization': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{nameNodeName}/host_components/NAMENODE?fields=metrics/dfs/FSNamesystem/CapacityRemainingGB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/CapacityUsedGB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/CapacityTotalGB[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/services/metrics/hdfs/space_utilization.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'dashboard.cluster_metrics.cpu': {
|
|
|
+ 'real': '/clusters/{clusterName}/?fields=metrics/cpu[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/cluster_metrics/cpu_1hr.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'dashboard.cluster_metrics.load': {
|
|
|
+ 'real': '/clusters/{clusterName}/?fields=metrics/load[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/cluster_metrics/load_1hr.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'dashboard.cluster_metrics.memory': {
|
|
|
+ 'real': '/clusters/{clusterName}/?fields=metrics/memory[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/cluster_metrics/memory_1hr.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'dashboard.cluster_metrics.network': {
|
|
|
+ 'real': '/clusters/{clusterName}/?fields=metrics/network[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/cluster_metrics/network_1hr.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'host.metrics.cpu': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{hostName}?fields=metrics/cpu/cpu_user[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_wio[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_nice[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_aidle[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_system[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_idle[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/hosts/metrics/cpu.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'host.metrics.disk': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{hostName}?fields=metrics/disk/disk_total[{fromSeconds},{toSeconds},{stepSeconds}],metrics/disk/disk_free[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/hosts/metrics/disk.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'host.metrics.load': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{hostName}?fields=metrics/load/load_fifteen[{fromSeconds},{toSeconds},{stepSeconds}],metrics/load/load_one[{fromSeconds},{toSeconds},{stepSeconds}],metrics/load/load_five[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/hosts/metrics/load.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'host.metrics.memory': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{hostName}?fields=metrics/memory/swap_free[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_shared[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_free[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_cached[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_buffers[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/hosts/metrics/memory.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'host.metrics.network': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{hostName}?fields=metrics/network/bytes_in[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/bytes_out[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/pkts_in[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/pkts_out[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/hosts/metrics/network.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'host.metrics.processes': {
|
|
|
+ 'real': '/clusters/{clusterName}/hosts/{hostName}?fields=metrics/process/proc_total[{fromSeconds},{toSeconds},{stepSeconds}],metrics/process/proc_run[{fromSeconds},{toSeconds},{stepSeconds}]',
|
|
|
+ 'mock': '/data/hosts/metrics/processes.json',
|
|
|
+ 'testInProduction': true
|
|
|
+ },
|
|
|
+ 'admin.security_status': {
|
|
|
+ 'real': '/clusters/{clusterName}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ timeout: 10000,
|
|
|
+ async: false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'admin.service_config': {
|
|
|
+ 'real': '/clusters/{clusterName}/configurations/?type={siteName}&tag={tagName}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ timeout: 10000,
|
|
|
+ async: false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'router.set_ambari_stacks': {
|
|
|
+ 'real': '/stacks',
|
|
|
+ 'mock': '/data/wizard/stack/stacks.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ async: false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'cluster.load_cluster_name': {
|
|
|
+ 'real': '/clusters',
|
|
|
+ 'mock': '/data/clusters/info.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ async: false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'cluster.update_upgrade_version': {
|
|
|
+ 'real': '/stacks2/HDP/versions?fields=stackServices/StackServices,Versions',
|
|
|
+ 'mock': '/data/wizard/stack/stacks.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ async: false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.launch_bootstrap': {
|
|
|
+ 'real': '/bootstrap',
|
|
|
+ 'mock': '/data/wizard/bootstrap/bootstrap.json',
|
|
|
+ 'format': function (data) {
|
|
|
+ return {
|
|
|
+ type: 'POST',
|
|
|
+ async: false,
|
|
|
+ contentType: 'application/json',
|
|
|
+ data: data.bootStrapData
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'admin.security.cluster_configs': {
|
|
|
+ 'real': '/clusters/{clusterName}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ timeout: 10000
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'admin.security.all_configurations': {
|
|
|
+ 'real': '/clusters/{clusterName}/configurations?{urlParams}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ timeout: 10000
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'admin.security.apply_configuration': {
|
|
|
+ 'real': '/clusters/{clusterName}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ timeout: 5000,
|
|
|
+ data: JSON.stringify(data.clusterData)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'admin.security.add.cluster_configs': {
|
|
|
+ 'real': '/clusters/{clusterName}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ timeout: 10000
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'service.start_stop': {
|
|
|
+ 'real': '/clusters/{clusterName}/services?ServiceInfo',
|
|
|
+ 'mock': '/data/mirroring/poll/poll_6.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'admin.stack_upgrade.run_upgrade': {
|
|
|
+ 'real':'/clusters/{clusterName}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'admin.stack_upgrade.stop_services': {
|
|
|
+ 'real': '/clusters/{clusterName}/services?ServiceInfo/state=STARTED',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'admin.stack_upgrade.do_poll': {
|
|
|
+ 'real': '/clusters/{cluster}/requests/{requestId}?fields=tasks/*',
|
|
|
+ 'mock': '/data/wizard/{mock}'
|
|
|
+ },
|
|
|
+ 'host.service_config_hosts_overrides': {
|
|
|
+ 'real': '/clusters/{clusterName}/configurations?{urlParams}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ async: false,
|
|
|
+ timeout: 10000
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.install_services.add_host_controller.is_retry': {
|
|
|
+ 'real': '/clusters/{cluster}/host_components?HostRoles/state=INSTALLED',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.install_services.add_host_controller.not_is_retry': {
|
|
|
+ 'real': '/clusters/{cluster}/host_components?HostRoles/state=INIT',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.install_services.installer_controller.is_retry': {
|
|
|
+ 'real': '/clusters/{cluster}/host_components?HostRoles/state!=INSTALLED',
|
|
|
+ 'mock': '/data/wizard/deploy/2_hosts/poll_1.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.install_services.installer_controller.not_is_retry': {
|
|
|
+ 'real': '/clusters/{cluster}/services?ServiceInfo/state=INIT',
|
|
|
+ 'mock': '/data/wizard/deploy/2_hosts/poll_1.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.service_components': {
|
|
|
+ 'real': '{stackUrl}',
|
|
|
+ 'mock': '/data/wizard/stack/hdp/version/1.3.0.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ async: false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.step9.installer.launch_start_services': {
|
|
|
+ 'real': '/clusters/{cluster}/services?ServiceInfo/state=INSTALLED',
|
|
|
+ 'mock': '/data/wizard/deploy/5_hosts/poll_6.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.step9.add_host.launch_start_services': {
|
|
|
+ 'real': '/clusters/{cluste}/host_components?(HostRoles/component_name=GANGLIA_MONITOR|HostRoles/component_name=HBASE_REGIONSERVER|HostRoles/component_name=DATANODE|HostRoles/component_name=TASKTRACKER)&(HostRoles/state=INSTALLED)',
|
|
|
+ 'mock': '/data/wizard/deploy/5_hosts/poll_6.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'PUT',
|
|
|
+ async: false,
|
|
|
+ data: data.data
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.step8.delete_cluster': {
|
|
|
+ 'real': '/clusters/{name}',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ type: 'DELETE',
|
|
|
+ async: false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.step8.existing_cluster_names': {
|
|
|
+ 'real': '/clusters',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ async: false
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.step3.host_info': {
|
|
|
+ 'real': '/hosts?fields=Hosts/total_mem,Hosts/cpu_count,Hosts/disk_info,Hosts/last_agent_env',
|
|
|
+ 'mock': '/data/wizard/bootstrap/two_hosts_information.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ contentType: 'application/json'
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.step3.rerun_checks': {
|
|
|
+ 'real': '/hosts?fields=Hosts/last_agent_env',
|
|
|
+ 'mock': '/data/wizard/bootstrap/two_hosts_information.json',
|
|
|
+ 'format': function (data, opt) {
|
|
|
+ return {
|
|
|
+ contentType: 'application/json'
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'wizard.step3.bootstrap': {
|
|
|
+ 'real': '/bootstrap/{bootRequestId}',
|
|
|
+ 'mock': '/data/wizard/bootstrap/poll_{numPolls}.json'
|
|
|
+ },
|
|
|
+ 'wizard.step3.is_hosts_registered': {
|
|
|
+ 'real': '/hosts',
|
|
|
+ 'mock': '/data/wizard/bootstrap/single_host_registration.json'
|
|
|
+ },
|
|
|
+ 'router.login': {
|
|
|
+ 'real': '/users/{loginName}',
|
|
|
+ 'mock': '/data/users/user_{usr}.json'
|
|
|
+ },
|
|
|
+ 'router.login2': {
|
|
|
+ 'real': '/clusters',
|
|
|
+ 'mock': '/data/clusters/info.json'
|
|
|
+ },
|
|
|
+ 'router.logoff': {
|
|
|
+ 'real': '/logout'
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
@@ -249,17 +673,19 @@ var urls = {
|
|
|
var formatUrl = function(url, data) {
|
|
|
var keys = url.match(/\{\w+\}/g);
|
|
|
keys = (keys === null) ? [] : keys;
|
|
|
- keys.forEach(function(key){
|
|
|
- var raw_key = key.substr(1, key.length - 2);
|
|
|
- var replace;
|
|
|
- if (!data[raw_key]) {
|
|
|
- replace = '';
|
|
|
- }
|
|
|
- else {
|
|
|
- replace = data[raw_key];
|
|
|
- }
|
|
|
- url = url.replace(new RegExp(key, 'g'), replace);
|
|
|
- });
|
|
|
+ if (keys) {
|
|
|
+ keys.forEach(function(key){
|
|
|
+ var raw_key = key.substr(1, key.length - 2);
|
|
|
+ var replace;
|
|
|
+ if (!data[raw_key]) {
|
|
|
+ replace = '';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ replace = data[raw_key];
|
|
|
+ }
|
|
|
+ url = url.replace(new RegExp(key, 'g'), replace);
|
|
|
+ });
|
|
|
+ }
|
|
|
return url;
|
|
|
};
|
|
|
|
|
@@ -310,6 +736,9 @@ App.ajax = {
|
|
|
* callback - callback from <code>App.updater.run</code> library
|
|
|
*/
|
|
|
send: function(config) {
|
|
|
+
|
|
|
+ console.warn('============== ajax ==============', config.name, config.data);
|
|
|
+
|
|
|
if (!config.sender) {
|
|
|
console.warn('Ajax sender should be defined!');
|
|
|
return null;
|
|
@@ -329,12 +758,13 @@ App.ajax = {
|
|
|
opt = formatRequest.call(urls[config.name], params);
|
|
|
|
|
|
// object sender should be provided for processing beforeSend, success and error responses
|
|
|
- opt.beforeSend = function() {
|
|
|
+ opt.beforeSend = function(xhr) {
|
|
|
if(config.beforeSend) {
|
|
|
- config.sender[config.beforeSend](opt);
|
|
|
+ config.sender[config.beforeSend](opt, xhr, params);
|
|
|
}
|
|
|
};
|
|
|
opt.success = function(data) {
|
|
|
+ console.log("TRACE: The url is: " + opt.url);
|
|
|
if(config.success) {
|
|
|
config.sender[config.success](data, opt, params);
|
|
|
}
|
|
@@ -352,7 +782,6 @@ App.ajax = {
|
|
|
if($.mocho){
|
|
|
opt.url = 'http://' + $.hostName + opt.url;
|
|
|
}
|
|
|
-
|
|
|
return $.ajax(opt);
|
|
|
}
|
|
|
-}
|
|
|
+}
|