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

Commit

Permalink
feat(dedicatedcloud): add zerto and ip details routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérémy DE CESARE committed Jan 30, 2019
1 parent 7803479 commit a08fd16
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ angular.module("ovh-api-services").service("OvhApiDedicatedCloudDatacenter", fun
},
Backup: function () {
return $injector.get("OvhApiDedicatedCloudDatacenterBackup");
},
Zerto: function () {
return $injector.get("OvhApiDedicatedCloudDatacenterZerto");
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -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");
}
};
});
Original file line number Diff line number Diff line change
@@ -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;
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
angular.module("ovh-api-services").service("OvhApiDedicatedCloudDatacenterZertoSingle", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiDedicatedCloudDatacenterZertoSingleV6");
}
};
});
Original file line number Diff line number Diff line change
@@ -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;
});
3 changes: 3 additions & 0 deletions src/dedicatedCloud/ip/dedicatedCloud-ip.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
angular.module("ovh-api-services").service("OvhApiDedicatedCloudIpDetails", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiDedicatedCloudIpDetailsV6");
}
};
});

0 comments on commit a08fd16

Please sign in to comment.