Skip to content

Commit

Permalink
Merge pull request #88 from Jiri-Kremser/tenant-headers
Browse files Browse the repository at this point in the history
removing the Hawkular-Tenant headers
  • Loading branch information
mtho11 committed Feb 8, 2016
2 parents cdf1a05 + de26e51 commit 05c7164
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 72 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ lib/
.classpath
.settings

#Atom
tsconfig.json

# OSX
.DS_Store
109 changes: 37 additions & 72 deletions src/rest/hawkRest-metric-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,32 @@ module hawkularRest {
queryGauges: {
method: 'GET',
isArray: true,
params: { type: 'gauge' },
headers: {'Hawkular-Tenant': tenantId}
params: { type: 'gauge' }
},
queryCounters: {
method: 'GET',
isArray: true,
params: { type: 'counter' },
headers: {'Hawkular-Tenant': tenantId}
params: { type: 'counter' }
},
queryAvailability: {
method: 'GET',
isArray: true,
params: { type: 'availability' },
headers: {'Hawkular-Tenant': tenantId}
params: { type: 'availability' }
}
});
};

factory.GaugeMetric = function(tenantId){
return $resource(url + '/gauges', null, {
get: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
method:'GET'
},
query: {
method:'GET',
isArray:true,
headers: {'Hawkular-Tenant': tenantId}
isArray:true
},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};
Expand All @@ -101,22 +95,18 @@ module hawkularRest {
}, {
queryMetrics: {
method: 'GET',
isArray: true,
headers: {'Hawkular-Tenant': tenantId}
isArray: true
},
queryMetricsTimeRange: {
method: 'GET',
isArray: true,
params: {buckets: 60, start: '@startTimestamp', end: '@endTimestamp'},
headers: {'Hawkular-Tenant': tenantId}
params: {buckets: 60, start: '@startTimestamp', end: '@endTimestamp'}
},
get: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
method:'GET'
},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};
Expand All @@ -126,17 +116,14 @@ module hawkularRest {
gaugeId : '@gaugeId'
}, {
get: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
method:'GET'
,
query: {
method:'GET',
isArray:true,
headers: {'Hawkular-Tenant': tenantId}
isArray:true
}},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};
Expand All @@ -149,7 +136,6 @@ module hawkularRest {
}, {
get: {
method: 'GET',
headers: {'Hawkular-Tenant': tenantId},
isArray: true,
params: {metrics: metrics, // send metrics=id1,metrics=id2,...
stacked:useStacked}
Expand All @@ -162,17 +148,14 @@ module hawkularRest {
factory.CounterMetric = function(tenantId){
return $resource(url + '/counters', null, {
get: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
method:'GET'
},
query: {
method:'GET',
isArray:true,
headers: {'Hawkular-Tenant': tenantId}
isArray:true
},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};
Expand All @@ -183,22 +166,18 @@ module hawkularRest {
}, {
queryMetrics: {
method: 'GET',
isArray: true,
headers: {'Hawkular-Tenant': tenantId}
isArray: true
},
queryMetricsTimeRange: {
method: 'GET',
isArray: true,
params: {buckets: 60, start: '@startTimestamp', end: '@endTimestamp'},
headers: {'Hawkular-Tenant': tenantId}
params: {buckets: 60, start: '@startTimestamp', end: '@endTimestamp'}
},
get: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
method:'GET'
},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};
Expand All @@ -208,17 +187,14 @@ module hawkularRest {
counterId : '@counterId'
}, {
get: {
method:'GET'
},
query: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
,
query: {
method:'GET',
isArray:true,
headers: {'Hawkular-Tenant': tenantId}
}},
isArray:true
},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};
Expand All @@ -229,32 +205,27 @@ module hawkularRest {
}, {
queryMetrics: {
method: 'GET',
isArray: true,
headers: {'Hawkular-Tenant': tenantId}
isArray: true
},
queryMetricsTimeRange: {
method: 'GET',
isArray: true,
params: {buckets: 60, start: '@startTimestamp', end: '@endTimestamp'},
headers: {'Hawkular-Tenant': tenantId}
params: {buckets: 60, start: '@startTimestamp', end: '@endTimestamp'}
}
});
};

factory.AvailabilityMetric = function(tenantId) {
return $resource(url + '/availability', null, {
get: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
method:'GET'
},
query: {
method:'GET',
isArray:true,
headers: {'Hawkular-Tenant': tenantId}
isArray:true
},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};
Expand All @@ -264,35 +235,29 @@ module hawkularRest {
availabilityId : '@availabilityId'
}, {
get: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
method:'GET'
},
query: {
method:'GET',
isArray:true,
headers: {'Hawkular-Tenant': tenantId}
isArray:true
},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};

factory.AvailabilityMetricMultiple = function(tenantId) {
return $resource(url + '/availability/data', null, {
get: {
method:'GET',
headers: {'Hawkular-Tenant': tenantId}
method:'GET'
},
query: {
method:'GET',
isArray:true,
headers: {'Hawkular-Tenant': tenantId}
isArray:true
},
save: {
method:'POST',
headers: {'Hawkular-Tenant': tenantId}
method:'POST'
}
});
};
Expand Down

0 comments on commit 05c7164

Please sign in to comment.