From a31a10ac999661df7d05937eaae9d864be4e2554 Mon Sep 17 00:00:00 2001 From: JeremyDec <34273689+JeremyDec@users.noreply.github.com> Date: Thu, 31 Jan 2019 08:30:45 +0100 Subject: [PATCH] feat(dedicatedcloud): add zerto and ip details routes (#129) --- .../dedicatedCloud-datacenter.service.js | 3 ++ ...dedicatedCloud-datacenter-zerto.service.js | 12 ++++++ ...icatedCloud-datacenter-zerto.v6.service.js | 39 +++++++++++++++++++ ...edCloud-datacenter-zerto-single.service.js | 9 +++++ ...loud-datacenter-zerto-single.v6.service.js | 29 ++++++++++++++ .../ip/dedicatedCloud-ip.service.js | 3 ++ .../dedicatedCloud-ip-details-v6.service.js | 17 ++++++++ .../dedicatedCloud-ip-details.service.js | 9 +++++ 8 files changed, 121 insertions(+) create mode 100644 src/dedicatedCloud/datacenter/zerto/dedicatedCloud-datacenter-zerto.service.js create mode 100644 src/dedicatedCloud/datacenter/zerto/dedicatedCloud-datacenter-zerto.v6.service.js create mode 100644 src/dedicatedCloud/datacenter/zerto/single/dedicatedCloud-datacenter-zerto-single.service.js create mode 100644 src/dedicatedCloud/datacenter/zerto/single/dedicatedCloud-datacenter-zerto-single.v6.service.js create mode 100644 src/dedicatedCloud/ip/details/dedicatedCloud-ip-details-v6.service.js create mode 100644 src/dedicatedCloud/ip/details/dedicatedCloud-ip-details.service.js diff --git a/src/dedicatedCloud/datacenter/dedicatedCloud-datacenter.service.js b/src/dedicatedCloud/datacenter/dedicatedCloud-datacenter.service.js index cbd675cb..d5f4c108 100644 --- a/src/dedicatedCloud/datacenter/dedicatedCloud-datacenter.service.js +++ b/src/dedicatedCloud/datacenter/dedicatedCloud-datacenter.service.js @@ -17,6 +17,9 @@ angular.module("ovh-api-services").service("OvhApiDedicatedCloudDatacenter", fun }, Backup: function () { return $injector.get("OvhApiDedicatedCloudDatacenterBackup"); + }, + Zerto: function () { + return $injector.get("OvhApiDedicatedCloudDatacenterZerto"); } }; diff --git a/src/dedicatedCloud/datacenter/zerto/dedicatedCloud-datacenter-zerto.service.js b/src/dedicatedCloud/datacenter/zerto/dedicatedCloud-datacenter-zerto.service.js new file mode 100644 index 00000000..eafeaf87 --- /dev/null +++ b/src/dedicatedCloud/datacenter/zerto/dedicatedCloud-datacenter-zerto.service.js @@ -0,0 +1,12 @@ +angular.module("ovh-api-services").service("OvhApiDedicatedCloudDatacenterZerto", function ($injector) { + "use strict"; + + return { + v6: function () { + return $injector.get("OvhApiDedicatedCloudDatacenterZertoV6"); + }, + Single: function () { + return $injector.get("OvhApiDedicatedCloudDatacenterZertoSingle"); + } + }; +}); diff --git a/src/dedicatedCloud/datacenter/zerto/dedicatedCloud-datacenter-zerto.v6.service.js b/src/dedicatedCloud/datacenter/zerto/dedicatedCloud-datacenter-zerto.v6.service.js new file mode 100644 index 00000000..4938f51a --- /dev/null +++ b/src/dedicatedCloud/datacenter/zerto/dedicatedCloud-datacenter-zerto.v6.service.js @@ -0,0 +1,39 @@ +angular.module("ovh-api-services").service("OvhApiDedicatedCloudDatacenterZertoV6", function ($cacheFactory, $resource) { + "use strict"; + + var cache = $cacheFactory("OvhApiDedicatedCloudDatacenterZertoV6"); + var interceptor = { + response: function (response) { + cache.removeAll(); + return response; + } + }; + + var zertoResource = $resource("/dedicatedCloud/:serviceName/datacenter/:datacenterId/disasterRecovery/zerto", { + serviceName: "@serviceName", + datacenterId: "@datacenterId" + }, { + disable: { + url: "/dedicatedCloud/:serviceName/datacenter/:datacenterId/disasterRecovery/zerto/disable", + method: "POST", + interceptor: interceptor + }, + enable: { + url: "/dedicatedCloud/:serviceName/datacenter/:datacenterId/disasterRecovery/zerto/enable", + method: "POST", + interceptor: interceptor + }, + generateZsspPassword: { + url: "/dedicatedCloud/:serviceName/datacenter/:datacenterId/disasterRecovery/zerto/generateZsspPassword", + method: "POST", + interceptor: interceptor + }, + state: { + url: "/dedicatedCloud/:serviceName/datacenter/:datacenterId/disasterRecovery/zerto/state", + method: "POST", + interceptor: interceptor + } + }); + + return zertoResource; +}); diff --git a/src/dedicatedCloud/datacenter/zerto/single/dedicatedCloud-datacenter-zerto-single.service.js b/src/dedicatedCloud/datacenter/zerto/single/dedicatedCloud-datacenter-zerto-single.service.js new file mode 100644 index 00000000..d98ee8ab --- /dev/null +++ b/src/dedicatedCloud/datacenter/zerto/single/dedicatedCloud-datacenter-zerto-single.service.js @@ -0,0 +1,9 @@ +angular.module("ovh-api-services").service("OvhApiDedicatedCloudDatacenterZertoSingle", function ($injector) { + "use strict"; + + return { + v6: function () { + return $injector.get("OvhApiDedicatedCloudDatacenterZertoSingleV6"); + } + }; +}); diff --git a/src/dedicatedCloud/datacenter/zerto/single/dedicatedCloud-datacenter-zerto-single.v6.service.js b/src/dedicatedCloud/datacenter/zerto/single/dedicatedCloud-datacenter-zerto-single.v6.service.js new file mode 100644 index 00000000..2f1377db --- /dev/null +++ b/src/dedicatedCloud/datacenter/zerto/single/dedicatedCloud-datacenter-zerto-single.v6.service.js @@ -0,0 +1,29 @@ +angular.module("ovh-api-services").service("OvhApiDedicatedCloudDatacenterZertoSingleV6", function ($cacheFactory, $resource) { + "use strict"; + + var cache = $cacheFactory("OvhApiDedicatedCloudDatacenterZertoSingleV6"); + var interceptor = { + response: function (response) { + cache.removeAll(); + return response; + } + }; + + var zertoSingleResource = $resource("/dedicatedCloud/:serviceName/datacenter/:datacenterId/disasterRecovery/zertoSingle", { + serviceName: "@serviceName", + datacenterId: "@datacenterId" + }, { + disable: { + url: "/dedicatedCloud/:serviceName/datacenter/:datacenterId/disasterRecovery/zertoSingle/disable", + method: "POST", + interceptor: interceptor + }, + enable: { + url: "/dedicatedCloud/:serviceName/datacenter/:datacenterId/disasterRecovery/zertoSingle/enable", + method: "POST", + interceptor: interceptor + } + }); + + return zertoSingleResource; +}); diff --git a/src/dedicatedCloud/ip/dedicatedCloud-ip.service.js b/src/dedicatedCloud/ip/dedicatedCloud-ip.service.js index 449a243d..842548e5 100644 --- a/src/dedicatedCloud/ip/dedicatedCloud-ip.service.js +++ b/src/dedicatedCloud/ip/dedicatedCloud-ip.service.js @@ -4,6 +4,9 @@ angular.module("ovh-api-services").service("OvhApiDedicatedCloudIp", function ($ return { v6: function () { return $injector.get("OvhApiDedicatedCloudIpV6"); + }, + Details: function () { + return $injector.get("OvhApiDedicatedCloudIpDetails"); } }; diff --git a/src/dedicatedCloud/ip/details/dedicatedCloud-ip-details-v6.service.js b/src/dedicatedCloud/ip/details/dedicatedCloud-ip-details-v6.service.js new file mode 100644 index 00000000..43b0ab11 --- /dev/null +++ b/src/dedicatedCloud/ip/details/dedicatedCloud-ip-details-v6.service.js @@ -0,0 +1,17 @@ +angular.module("ovh-api-services").service("OvhApiDedicatedCloudIpDetailsV6", function ($cacheFactory, $resource) { + "use strict"; + var cache = $cacheFactory("OvhApiDedicatedCloudIpDetailsV6"); + + var ipDetailsResource = $resource("/dedicatedCloud/:serviceName/ip/:network/details", { + serviceName: "@serviceName", + network: "@network" + }, { + get: { method: "GET", cache: cache, isArray: true } + }); + + ipDetailsResource.resetCache = function () { + cache.removeAll(); + }; + + return ipDetailsResource; +}); diff --git a/src/dedicatedCloud/ip/details/dedicatedCloud-ip-details.service.js b/src/dedicatedCloud/ip/details/dedicatedCloud-ip-details.service.js new file mode 100644 index 00000000..569d9ffb --- /dev/null +++ b/src/dedicatedCloud/ip/details/dedicatedCloud-ip-details.service.js @@ -0,0 +1,9 @@ +angular.module("ovh-api-services").service("OvhApiDedicatedCloudIpDetails", function ($injector) { + "use strict"; + + return { + v6: function () { + return $injector.get("OvhApiDedicatedCloudIpDetailsV6"); + } + }; +});