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

feat(dedicatedcloud): add zerto and ip details routes #129

Merged
merged 1 commit into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
}
};
});