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

Commit

Permalink
feat: add OLA group/ungroup endpoints (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
euhmeuh authored and Cyrille Bourgois committed Sep 26, 2019
1 parent 2a2c3e0 commit 838aeda
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
3 changes: 3 additions & 0 deletions src/api/dedicated/server/dedicated-server.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ angular.module('ovh-api-services').service('OvhApiDedicatedServer', $injector =>
Aapi() {
return $injector.get('OvhApiDedicatedServerAapi');
},
Ola() {
return $injector.get('OvhApiDedicatedServerOla');
},
PhysicalInterface() {
return $injector.get('OvhApiDedicatedServerPhysicalInterface');
},
Expand Down
20 changes: 0 additions & 20 deletions src/api/dedicated/server/nic/dedicated-server.nic.v6.service.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
angular.module('ovh-api-services').service('OvhApiDedicatedServerPhysicalInterfaceV6', ($resource, $cacheFactory) => {
const cache = $cacheFactory('OvhApiDedicatedServerPhysicalInterfaceV6');

const interceptor = {
response(response) {
dedicatedServerPhysicalInterfaceResource.resetCache();
return response.data;
},
};

const dedicatedServerPhysicalInterfaceResource = $resource('/dedicated/server/:serverName/networkInterfaceController', {
serverName: '@serverName',
}, {
Expand All @@ -34,19 +27,6 @@ angular.module('ovh-api-services').service('OvhApiDedicatedServerPhysicalInterfa
type: '@type',
},
},
bind: {
url: '/dedicated/server/:serverName/networkInterfaceController/:mac/bind',
method: 'POST',
interceptor,
params: {
virtualNetworkInterface: '@virtualNetworkInterface',
},
},
unbind: {
url: '/dedicated/server/:serverName/networkInterfaceController/:mac/unbind',
method: 'POST',
interceptor,
},
});

dedicatedServerPhysicalInterfaceResource.resetAllCache = function resetAllCache() {
Expand Down
5 changes: 5 additions & 0 deletions src/api/dedicated/server/ola/dedicated-server.ola.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
angular.module('ovh-api-services').service('OvhApiDedicatedServerOla', $injector => ({
v6() {
return $injector.get('OvhApiDedicatedServerOlaV6');
},
}));
17 changes: 17 additions & 0 deletions src/api/dedicated/server/ola/dedicated-server.ola.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
angular.module('ovh-api-services').service('OvhApiDedicatedServerOlaV6', ($resource) => {
const dedicatedServerOlaResource = $resource('/dedicated/server/:serverName/ola', {
serverName: '@serverName',
}, {
group: {
url: '/dedicated/server/:serverName/ola/group',
method: 'POST',
},
ungroup: {
url: '/dedicated/server/:serverName/ola/ungroup',
method: 'POST',
isArray: true,
},
});

return dedicatedServerOlaResource;
});
18 changes: 13 additions & 5 deletions src/api/dedicated/server/vni/dedicated-server.vni.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,46 @@ angular.module('ovh-api-services').service('OvhApiDedicatedServerVirtualInterfac
url: '/dedicated/server/:serverName/virtualNetworkInterface',
method: 'POST',
interceptor,
params: {
mode: '@mode',
name: '@name',
},
},
get: {
url: '/dedicated/server/:serverName/virtualNetworkInterface/:uuid',
method: 'GET',
cache,
params: {
uuid: '@uuid',
},
},
update: {
url: '/dedicated/server/:serverName/virtualNetworkInterface/:uuid',
method: 'PUT',
interceptor,
params: {
VirtualNetworkInterface: '@virtualNetworkInterface',
uuid: '@uuid',
},
},
delete: {
url: '/dedicated/server/:serverName/virtualNetworkInterface/:uuid',
method: 'DELETE',
interceptor,
params: {
uuid: '@uuid',
},
},
enable: {
url: '/dedicated/server/:serverName/virtualNetworkInterface/:uuid/enable',
method: 'POST',
interceptor,
params: {
uuid: '@uuid',
},
},
disable: {
url: '/dedicated/server/:serverName/virtualNetworkInterface/:uuid/disable',
method: 'POST',
interceptor,
params: {
uuid: '@uuid',
},
},
});

Expand Down

0 comments on commit 838aeda

Please sign in to comment.