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: enterprise cloud database apis (#232)
- Loading branch information
1 parent
f3c7ee6
commit 944a193
Showing
36 changed files
with
658 additions
and
2 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,8 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDB', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBV6'); | ||
}, | ||
Enterprise() { | ||
return $injector.get('OvhApiCloudDBEnterprise'); | ||
}, | ||
})); |
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,17 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBV6', ($resource, $cacheFactory) => { | ||
const queryCache = $cacheFactory('OvhApiCloudDBV6Query'); | ||
|
||
const cloudDbResource = $resource('/cloudDB', {}, { | ||
query: { | ||
method: 'GET', | ||
isArray: true, | ||
cache: queryCache, | ||
}, | ||
}); | ||
|
||
cloudDbResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return cloudDbResource; | ||
}); |
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,4 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterpriseBackupIceberg', iceberg => iceberg('/cloudDB/enterprise/cluster/:clusterId/backup/:backupId', { | ||
clusterId: '@clusterId', | ||
backupId: '@backupId', | ||
})); |
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,8 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterpriseBackup', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseBackupV6'); | ||
}, | ||
Iceberg() { | ||
return $injector.get('OvhApiCloudDBEnterpriseBackupIceberg'); | ||
}, | ||
})); |
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,36 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterpriseBackupV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiCloudDBEnterpriseBackupV6'); | ||
const queryCache = $cacheFactory('OvhApiCloudDBEnterpriseBackupV6Query'); | ||
const interceptor = { | ||
response(response) { | ||
cache.remove(response.config.url); | ||
queryCache.removeAll(); | ||
return response; | ||
}, | ||
}; | ||
|
||
const backupResource = $resource('/cloudDB/enterprise/cluster/:clusterId/backup/:backupId', { | ||
clusterId: '@clusterId', | ||
backupId: '@backupId', | ||
}, { | ||
query: { method: 'GET', isArray: true, cache: queryCache }, | ||
get: { method: 'GET', cache }, | ||
create: { method: 'POST', interceptor }, | ||
delete: { method: 'DELETE', interceptor }, | ||
}); | ||
|
||
backupResource.resetAllCache = function () { | ||
backupResource.resetCache(); | ||
backupResource.resetQueryCache(); | ||
}; | ||
|
||
backupResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
backupResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return backupResource; | ||
}); |
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('OvhApiCloudDBEnterpriseEndpoint', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseEndpointV6'); | ||
}, | ||
})); |
27 changes: 27 additions & 0 deletions
27
src/api/cloudDb/enterprise/endpoint/endpoint.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,27 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterpriseEndpointV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiCloudDBEnterpriseEndpointV6'); | ||
const queryCache = $cacheFactory('OvhApiCloudDBEnterpriseEndpointV6Query'); | ||
|
||
const endpointResource = $resource('/cloudDB/enterprise/cluster/:clusterId/endpoint/:endpointId', { | ||
clusterId: '@clusterId', | ||
endpointId: '@endpointId', | ||
}, { | ||
query: { method: 'GET', isArray: true, cache: queryCache }, | ||
get: { method: 'GET', cache }, | ||
}); | ||
|
||
endpointResource.resetAllCache = function () { | ||
endpointResource.resetCache(); | ||
endpointResource.resetQueryCache(); | ||
}; | ||
|
||
endpointResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
endpointResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return endpointResource; | ||
}); |
41 changes: 41 additions & 0 deletions
41
src/api/cloudDb/enterprise/enterprise-cloud-database.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,41 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterprise', $injector => ({ | ||
Backup() { | ||
return $injector.get('OvhApiCloudDBEnterpriseBackup'); | ||
}, | ||
Endpoint() { | ||
return $injector.get('OvhApiCloudDBEnterpriseEndpoint'); | ||
}, | ||
Host() { | ||
return $injector.get('OvhApiCloudDBEnterpriseHost'); | ||
}, | ||
Logs() { | ||
return $injector.get('OvhApiCloudDBEnterpriseLogs'); | ||
}, | ||
Maintenance() { | ||
return $injector.get('OvhApiCloudDBEnterpriseMaintenance'); | ||
}, | ||
MaintenanceWindow() { | ||
return $injector.get('OvhApiCloudDBEnterpriseMaintenanceWindow'); | ||
}, | ||
Offers() { | ||
return $injector.get('OvhApiCloudDBEnterpriseOffers'); | ||
}, | ||
Region() { | ||
return $injector.get('OvhApiCloudDBEnterpriseRegion'); | ||
}, | ||
Restore() { | ||
return $injector.get('OvhApiCloudDBEnterpriseRestore'); | ||
}, | ||
SecurityGroup() { | ||
return $injector.get('OvhApiCloudDBEnterpriseSecurityGroup'); | ||
}, | ||
ServiceInfos() { | ||
return $injector.get('OvhApiCloudDBEnterpriseServiceInfos'); | ||
}, | ||
User() { | ||
return $injector.get('OvhApiCloudDBEnterpriseUser'); | ||
}, | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseClusterV6'); | ||
}, | ||
})); |
39 changes: 39 additions & 0 deletions
39
src/api/cloudDb/enterprise/enterprise-cloud-database.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,39 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterpriseClusterV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiCloudDBEnterpriseClusterV6'); | ||
const queryCache = $cacheFactory('OvhApiCloudDBEnterpriseClusterV6Query'); | ||
const interceptor = { | ||
response(response) { | ||
cache.remove(response.config.url); | ||
queryCache.removeAll(); | ||
return response; | ||
}, | ||
}; | ||
|
||
const enterpriseCloudResource = $resource('/cloudDB/enterprise/cluster/:clusterId', { | ||
clusterId: '@clusterId', | ||
}, { | ||
query: { method: 'GET', isArray: true, cache: queryCache }, | ||
get: { method: 'GET', cache }, | ||
update: { method: 'PUT', interceptor }, | ||
scale: { | ||
url: '/cloudDB/enterprise/cluster/:clusterId/scale', | ||
method: 'POST', | ||
interceptor, | ||
}, | ||
}); | ||
|
||
enterpriseCloudResource.resetAllCache = function () { | ||
enterpriseCloudResource.resetCache(); | ||
enterpriseCloudResource.resetQueryCache(); | ||
}; | ||
|
||
enterpriseCloudResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
enterpriseCloudResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return enterpriseCloudResource; | ||
}); |
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('OvhApiCloudDBEnterpriseHost', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseHostV6'); | ||
}, | ||
})); |
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,27 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterpriseHostV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiCloudDBEnterpriseHostV6'); | ||
const queryCache = $cacheFactory('OvhApiCloudDBEnterpriseHostV6Query'); | ||
|
||
const hostResource = $resource('/cloudDB/enterprise/cluster/:clusterId/host/:hostId', { | ||
clusterId: '@clusterId', | ||
hostId: '@hostId', | ||
}, { | ||
query: { method: 'GET', isArray: true, cache: queryCache }, | ||
get: { method: 'GET', cache }, | ||
}); | ||
|
||
hostResource.resetAllCache = function () { | ||
hostResource.resetCache(); | ||
hostResource.resetQueryCache(); | ||
}; | ||
|
||
hostResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
hostResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return hostResource; | ||
}); |
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('OvhApiCloudDBEnterpriseLogs', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseLogsV6'); | ||
}, | ||
})); |
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('OvhApiCloudDBEnterpriseLogsV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiCloudDBEnterpriseLogsV6'); | ||
const queryCache = $cacheFactory('OvhApiCloudDBEnterpriseLogsV6Query'); | ||
const interceptor = { | ||
response(response) { | ||
cache.remove(response.config.url); | ||
queryCache.removeAll(); | ||
return response; | ||
}, | ||
}; | ||
|
||
const logsResource = $resource('/cloudDB/enterprise/cluster/:clusterId/logs/:logsId', { | ||
clusterId: '@clusterId', | ||
logsId: '@logsId', | ||
}, { | ||
query: { method: 'GET', isArray: true, cache: queryCache }, | ||
get: { method: 'GET', cache }, | ||
delete: { method: 'DELETE', interceptor }, | ||
}); | ||
|
||
logsResource.resetAllCache = function () { | ||
logsResource.resetCache(); | ||
logsResource.resetQueryCache(); | ||
}; | ||
|
||
logsResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
logsResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return logsResource; | ||
}); |
5 changes: 5 additions & 0 deletions
5
src/api/cloudDb/enterprise/maintenance-window/maintenance-window.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('OvhApiCloudDBEnterpriseMaintenanceWindow', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseMaintenanceWindowV6'); | ||
}, | ||
})); |
29 changes: 29 additions & 0 deletions
29
src/api/cloudDb/enterprise/maintenance-window/maintenance-window.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,29 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterpriseMaintenanceWindowV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiCloudDBEnterpriseMaintenanceWindowV6'); | ||
const interceptor = { | ||
response(response) { | ||
cache.remove(response.config.url); | ||
return response; | ||
}, | ||
}; | ||
|
||
const maintenanceWindowResource = $resource('/cloudDB/enterprise/cluster/:clusterId/maintenanceWindow', { | ||
clusterId: '@clusterId', | ||
}, { | ||
get: { method: 'GET', cache }, | ||
create: { method: 'POST', interceptor }, | ||
update: { method: 'PUT', interceptor }, | ||
delete: { method: 'DELETE', interceptor }, | ||
}); | ||
|
||
maintenanceWindowResource.resetAllCache = function () { | ||
maintenanceWindowResource.resetCache(); | ||
maintenanceWindowResource.resetQueryCache(); | ||
}; | ||
|
||
maintenanceWindowResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
return maintenanceWindowResource; | ||
}); |
5 changes: 5 additions & 0 deletions
5
src/api/cloudDb/enterprise/maintenance/maintenance.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('OvhApiCloudDBEnterpriseMaintenance', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseMaintenanceV6'); | ||
}, | ||
})); |
35 changes: 35 additions & 0 deletions
35
src/api/cloudDb/enterprise/maintenance/maintenance.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('OvhApiCloudDBEnterpriseMaintenanceV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiCloudDBEnterpriseMaintenanceV6'); | ||
const queryCache = $cacheFactory('OvhApiCloudDBEnterpriseMaintenanceV6Query'); | ||
const interceptor = { | ||
response(response) { | ||
cache.remove(response.config.url); | ||
queryCache.removeAll(); | ||
return response; | ||
}, | ||
}; | ||
|
||
const maintenanceResource = $resource('/cloudDB/enterprise/cluster/:clusterId/maintenance/:maintenanceId', { | ||
clusterId: '@clusterId', | ||
maintenanceId: '@maintenanceId', | ||
}, { | ||
query: { method: 'GET', isArray: true, cache: queryCache }, | ||
get: { method: 'GET', cache }, | ||
delete: { method: 'DELETE', interceptor }, | ||
}); | ||
|
||
maintenanceResource.resetAllCache = function () { | ||
maintenanceResource.resetCache(); | ||
maintenanceResource.resetQueryCache(); | ||
}; | ||
|
||
maintenanceResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
maintenanceResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return maintenanceResource; | ||
}); |
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('OvhApiCloudDBEnterpriseOffers', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseOffersV6'); | ||
}, | ||
})); |
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,39 @@ | ||
angular.module('ovh-api-services').service('OvhApiCloudDBEnterpriseOffersV6', ($resource, $cacheFactory) => { | ||
const cache = $cacheFactory('OvhApiCloudDBEnterpriseOffersV6'); | ||
const queryCache = $cacheFactory('OvhApiCloudDBEnterpriseOffersV6Query'); | ||
|
||
const offersResource = $resource('/cloudDB/enterprise/offer/:name', { | ||
name: '@name', | ||
}, { | ||
query: { method: 'GET', isArray: true, cache: queryCache }, | ||
get: { method: 'GET', cache }, | ||
getRegions: { | ||
method: 'GET', | ||
isArray: true, | ||
cache, | ||
url: '/cloudDB/enterprise/offer/:name/region', | ||
}, | ||
getAvailableHostCount: { | ||
method: 'GET', | ||
url: '/cloudDB/enterprise/offer/:name/region/:regionName', | ||
params: { | ||
regionName: '@regionName', | ||
}, | ||
}, | ||
}); | ||
|
||
offersResource.resetAllCache = function () { | ||
offersResource.resetCache(); | ||
offersResource.resetQueryCache(); | ||
}; | ||
|
||
offersResource.resetCache = function () { | ||
cache.removeAll(); | ||
}; | ||
|
||
offersResource.resetQueryCache = function () { | ||
queryCache.removeAll(); | ||
}; | ||
|
||
return offersResource; | ||
}); |
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('OvhApiCloudDBEnterpriseRegion', $injector => ({ | ||
v6() { | ||
return $injector.get('OvhApiCloudDBEnterpriseRegionV6'); | ||
}, | ||
})); |
Oops, something went wrong.