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 servicePacks api bindings (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericEspiau authored and antleblanc committed Jun 6, 2019
1 parent 981551f commit 4b66a23
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dedicatedCloud/dedicatedCloud.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
angular
.module("ovh-api-services")
.service("OvhApiDedicatedCloudServicePacks", function ($injector) {
"use strict";

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

});
Original file line number Diff line number Diff line change
@@ -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;
});

0 comments on commit 4b66a23

Please sign in to comment.