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(hosting): add extraSqlPerso path
Signed-off-by: Frederic Espiau <[email protected]>
- Loading branch information
Frederic Espiau
committed
Feb 12, 2020
1 parent
140a8e5
commit b1c916f
Showing
3 changed files
with
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
angular.module('ovh-api-services').service('OvhApiHostingWebExtraSqlPerso', ($injector) => ({ | ||
v6() { | ||
return $injector.get('OvhApiHostingWebExtraSqlPersoV6'); | ||
}, | ||
})); |
63 changes: 63 additions & 0 deletions
63
src/api/hosting/web/extraSqlPerso/extraSqlPerso.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,63 @@ | ||
angular.module('ovh-api-services').service('OvhApiHostingWebExtraSqlPersoV6', ($cacheFactory, $resource) => { | ||
const cache = $cacheFactory('OvhApiAnalyticsPlatformsV6'); | ||
const queryCache = $cacheFactory('OvhApiAnalyticsPlatformsV6Query'); | ||
|
||
const interceptor = { | ||
response(response) { | ||
cache.resetCache(); | ||
queryCache.resetCache(); | ||
return response.data; | ||
}, | ||
}; | ||
|
||
const resource = $resource('/hosting/web/:serviceName/extraSqlPerso/:name', { | ||
serviceName: '@serviceName', | ||
name: '@name', | ||
}, { | ||
query: { | ||
method: 'GET', | ||
isArray: true, | ||
cache: queryCache, | ||
}, | ||
|
||
get: { | ||
method: 'GET', | ||
cache, | ||
}, | ||
|
||
queryDatabases: { | ||
url: '/hosting/web/:serviceName/extraSqlPerso/:name/databases', | ||
method: 'GET', | ||
isArray: true, | ||
cache: queryCache, | ||
}, | ||
|
||
getServiceInfos: { | ||
url: '/hosting/web/:serviceName/extraSqlPerso/:name/serviceInfos', | ||
method: 'GET', | ||
cache, | ||
}, | ||
|
||
updateServiceInfos: { | ||
url: '/hosting/web/:serviceName/extraSqlPerso/:name/serviceInfosUpdate', | ||
method: 'POST', | ||
interceptor, | ||
}, | ||
|
||
terminate: { | ||
url: '/hosting/web/:serviceName/extraSqlPerso/:name/terminate', | ||
method: 'POST', | ||
interceptor, | ||
}, | ||
}); | ||
|
||
resource.resetCache = function resetCache() { | ||
cache.removeAll(); | ||
}; | ||
|
||
resource.resetQueryCache = function resetQueryCache() { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return resource; | ||
}); |
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