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

Commit

Permalink
feat(firmware): add endpoint for modem firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffy29 authored and antleblanc committed Nov 7, 2018
1 parent e657197 commit 401edb9
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/xdsl/modem/firmware/xdsl-modem-firmware.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
angular.module("ovh-api-services").service("OvhApiXdslModemFirmware", function ($injector, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiXdslModemFirmware");

return {
v6: function () {
return $injector.get("OvhApiXdslModemFirmwareV6");
},
resetCache: cache.removeAll,
cache: cache
};
});
29 changes: 29 additions & 0 deletions src/xdsl/modem/firmware/xdsl-modem-firmware.v6.services.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
angular.module("ovh-api-services").service("OvhApiXdslModemFirmwareV6", function ($resource, OvhApiXdslModemFirmware) {
"use strict";

var interceptor = {
response: function (response) {
OvhApiXdslModemFirmware.resetCache();
return response.resource;
}
};

return $resource("/xdsl/:xdslId/modem/firmware", {
xdslId: "@xdslId"
}, {
get: {
method: "GET",
reponseType: "text"
},
post: {
method: "POST",
interceptor: interceptor
},
available: {
method: "GET",
url: "/xdsl/:xdslId/modem/firmwareAvailable",
isArray: true,
cache: OvhApiXdslModemFirmware.cache
}
});
});
3 changes: 3 additions & 0 deletions src/xdsl/modem/xdsl-modem.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ angular.module("ovh-api-services").service("OvhApiXdslModem", function ($injecto
AvailableWLANChannel: function () {
return $injector.get("OvhApiXdslModemAvailableWLANChannel");
},
Firmware: function () {
return $injector.get("OvhApiXdslModemFirmware");
},
cache: cache
};
});

0 comments on commit 401edb9

Please sign in to comment.