Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
feat(cloud.project): added load balancer endpoints (#287)
Browse files Browse the repository at this point in the history
Co-authored-by: Ravindra Adireddy <[email protected]>
  • Loading branch information
radireddy and Ravindra Adireddy authored Mar 10, 2020
1 parent e7ec873 commit 2dce218
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/cloud/project/cloud-project.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,8 @@ angular.module('ovh-api-services').service('OvhApiCloudProject', ($injector, $ca
ContainerRegistry() {
return $injector.get('OvhApiCloudProjectContainerRegistry');
},
LoadBalancer() {
return $injector.get('OvhApiCloudProjectLoadBalancer');
},
};
});
5 changes: 5 additions & 0 deletions src/api/cloud/project/loadBalancer/loadBalancer.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
angular.module('ovh-api-services').service('OvhApiCloudProjectLoadBalancer', ($injector) => ({
v6() {
return $injector.get('OvhApiCloudProjectLoadBalancerV6');
},
}));
27 changes: 27 additions & 0 deletions src/api/cloud/project/loadBalancer/loadBalancer.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
angular.module('ovh-api-services').service('OvhApiCloudProjectLoadBalancerV6', ($resource, $cacheFactory) => {
const cache = $cacheFactory('OvhApiCloudProjectLoadBalancerV6');
const queryCache = $cacheFactory('OvhApiCloudProjectLoadBalancerV6Query');

const lbResource = $resource('/cloud/project/:serviceName/loadbalancer/:loadBalancerId', {
serviceName: '@serviceName',
loadBalancerId: '@loadBalancerId',
}, {
query: { method: 'GET', isArray: true, cache: queryCache },
get: { method: 'GET', cache },
getStats: {
url: '/cloud/project/:serviceName/loadbalancer/:loadBalancerId/stats',
method: 'GET',
cache,
},
});

lbResource.resetCache = function () {
cache.removeAll();
};

lbResource.resetQueryCache = function () {
queryCache.removeAll();
};

return lbResource;
});

0 comments on commit 2dce218

Please sign in to comment.