From 4b66a23522361c0ff7a99d242bae86b5d86c4c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Espiau?= <7319147+FredericEspiau@users.noreply.github.com> Date: Thu, 6 Jun 2019 18:07:54 +0200 Subject: [PATCH] feat(dedicatedCloud): add servicePacks api bindings (#176) --- src/dedicatedCloud/dedicatedCloud.service.js | 3 ++ .../dedicatedCloud-servicePacks.service.js | 12 +++++++ .../dedicatedCloud-servicePacks.v6.service.js | 36 +++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 src/dedicatedCloud/servicePacks/dedicatedCloud-servicePacks.service.js create mode 100644 src/dedicatedCloud/servicePacks/dedicatedCloud-servicePacks.v6.service.js diff --git a/src/dedicatedCloud/dedicatedCloud.service.js b/src/dedicatedCloud/dedicatedCloud.service.js index 264ae360..65a91d3b 100644 --- a/src/dedicatedCloud/dedicatedCloud.service.js +++ b/src/dedicatedCloud/dedicatedCloud.service.js @@ -26,6 +26,9 @@ angular.module("ovh-api-services").service("OvhApiDedicatedCloud", function ($in Option: function () { return $injector.get("OvhApiDedicatedCloudOption"); }, + ServicePacks: function () { + return $injector.get("OvhApiDedicatedCloudServicePacks"); + }, Task: function () { return $injector.get("OvhApiDedicatedCloudTask"); }, diff --git a/src/dedicatedCloud/servicePacks/dedicatedCloud-servicePacks.service.js b/src/dedicatedCloud/servicePacks/dedicatedCloud-servicePacks.service.js new file mode 100644 index 00000000..0454817e --- /dev/null +++ b/src/dedicatedCloud/servicePacks/dedicatedCloud-servicePacks.service.js @@ -0,0 +1,12 @@ +angular + .module("ovh-api-services") + .service("OvhApiDedicatedCloudServicePacks", function ($injector) { + "use strict"; + + return { + v6: function () { + return $injector.get("OvhApiDedicatedCloudServicePacksV6"); + } + }; + + }); diff --git a/src/dedicatedCloud/servicePacks/dedicatedCloud-servicePacks.v6.service.js b/src/dedicatedCloud/servicePacks/dedicatedCloud-servicePacks.v6.service.js new file mode 100644 index 00000000..2f017460 --- /dev/null +++ b/src/dedicatedCloud/servicePacks/dedicatedCloud-servicePacks.v6.service.js @@ -0,0 +1,36 @@ +angular + .module("ovh-api-services") + .service("OvhApiDedicatedCloudServicePacksV6", function ($resource, $cacheFactory) { + "use strict"; + + var queryCache = $cacheFactory("OvhApiDedicatedCloudServicePacksV6Query"); + var cache = $cacheFactory("OvhApiDedicatedCloudServicePacksV6"); + + var servicePacksResource = $resource("/dedicatedCloud/:serviceName/servicePacks", { + serviceName: "@serviceName" + }, { + get: { + cache: cache, + method: "GET", + params: { + name: "@name" + }, + url: "/dedicatedCloud/:serviceName/servicePacks/:name" + }, + query: { + cache: queryCache, + isArray: true, + method: "GET" + } + }); + + servicePacksResource.resetCache = function () { + cache.removeAll(); + }; + + servicePacksResource.resetQueryCache = function () { + queryCache.removeAll(); + }; + + return servicePacksResource; + });