This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dbaas.logs): add kibana endpoints (#290)
Signed-off-by: Pierre De Paepe <[email protected]>
- Loading branch information
Showing
7 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/api/dbaas/logs/output/elasticsearch/elasticsearch.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
angular.module('ovh-api-services').service('OvhApiDbaasLogsOutputElasticsearchKibana', ($injector) => ({ | ||
Kibana() { | ||
return $injector.get('OvhApiDbaasLogsOutputElasticsearch'); | ||
}, | ||
})); |
25 changes: 25 additions & 0 deletions
25
src/api/dbaas/logs/output/elasticsearch/kibana/kibana.aapi.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
angular.module('ovh-api-services').service('OvhApiDbaasLogsOutputElasticsearchKibanaAapi', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiDbaasLogsOutputElasticsearchKibanaAapi'); | ||
|
||
const kibana = $resource('/dbaas/logs/:serviceName/kibana/:kibanaId', { | ||
serviceName: '@serviceName', | ||
kibanaId: '@kibanaId', | ||
}, { | ||
get: { | ||
method: 'GET', | ||
serviceType: 'aapi', | ||
cache, | ||
isArray: false, | ||
}, | ||
}); | ||
|
||
kibana.resetAllCache = function () { | ||
kibana.resetCache(); | ||
}; | ||
|
||
kibana.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
return kibana; | ||
}); |
10 changes: 10 additions & 0 deletions
10
src/api/dbaas/logs/output/elasticsearch/kibana/kibana.iceberg.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
angular.module('ovh-api-services').service('OvhApiDbaasLogsOutputElasticsearchKibanaIceberg', (iceberg) => { | ||
const kibanaResource = iceberg('/dbaas/logs/:serviceName/output/elasticsearch/kibana/:kibanaId', { | ||
serviceName: '@serviceName', | ||
kibanaId: '@kibanaId', | ||
}, { | ||
create: { method: 'POST' }, | ||
}); | ||
|
||
return kibanaResource; | ||
}); |
11 changes: 11 additions & 0 deletions
11
src/api/dbaas/logs/output/elasticsearch/kibana/kibana.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
angular.module('ovh-api-services').service('OvhApiDbaasLogsOutputElasticsearchKibana', ($injector) => ({ | ||
v6() { | ||
return $injector.get('OvhApiDbaasLogsOutputElasticsearchKibanaV6'); | ||
}, | ||
Iceberg() { | ||
return $injector.get('OvhApiDbaasLogsOutputElasticsearchKibanaIceberg'); | ||
}, | ||
Aapi() { | ||
return $injector.get('OvhApiDbaasLogsOutputElasticsearchKibanaAapi'); | ||
}, | ||
})); |
35 changes: 35 additions & 0 deletions
35
src/api/dbaas/logs/output/elasticsearch/kibana/kibana.v6.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
angular.module('ovh-api-services').service('OvhApiDbaasLogsOutputElasticsearchKibanaV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiDbaasLogsOutputElasticsearchKibanaV6'); | ||
const queryCache = $cacheFactory('OvhApiDbaasLogsOutputElasticsearchKibanaV6Query'); | ||
const interceptor = { | ||
response(response) { | ||
cache.remove(response.config.url); | ||
queryCache.removeAll(); | ||
return response; | ||
}, | ||
}; | ||
|
||
const kibanaResource = $resource('/dbaas/logs/:serviceName/output/elasticsearch/kibana/:kibanaId', { | ||
serviceName: '@serviceName', | ||
kibanaId: '@kibanaId', | ||
}, { | ||
query: { method: 'GET', isArray: true, cache: queryCache }, | ||
create: { method: 'POST', interceptor }, | ||
remove: { method: 'DELETE', interceptor }, | ||
}); | ||
|
||
kibanaResource.resetAllCache = function () { | ||
kibanaResource.resetCache(); | ||
kibanaResource.resetQueryCache(); | ||
}; | ||
|
||
kibanaResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
kibanaResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return kibanaResource; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
angular.module('ovh-api-services').service('OvhApiDbaasLogsOutput', ($injector) => ({ | ||
Elasticsearch() { | ||
return $injector.get('OvhApiDbaasLogsOutputElasticsearch'); | ||
}, | ||
})); |