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

Commit

Permalink
feat(analytics.platforms): add nodes api bindings (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshkumar1989 authored and antleblanc committed May 31, 2019
1 parent b4f4578 commit d1670cd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/analytics/platforms/node/platforms-node.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
angular.module("ovh-api-services").service("OvhApiAnalyticsPlatformsNode", function ($injector) {
"use strict";
return {
v6: function () {
return $injector.get("OvhApiAnalyticsPlatformsNodeV6");
}
};
});
28 changes: 28 additions & 0 deletions src/analytics/platforms/node/platforms-node.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
angular.module("ovh-api-services").service("OvhApiAnalyticsPlatformsNodeV6", function ($resource, $cacheFactory) {
"use strict";

var cache = $cacheFactory("OvhApiAnalyticsPlatformsNodeV6");
var queryCache = $cacheFactory("OvhApiAnalyticsPlatformsNodeV6Query");

var adpResource = $resource("/analytics/platforms/:serviceName/nodes/:nodeId", {
serviceName: "@serviceName",
nodeId: "@nodeId"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
get: { method: "GET", cache: cache }
});

adpResource.resetCache = function () {
cache.removeAll();
};

adpResource.resetQueryCache = function () {
queryCache.removeAll();
};

return adpResource;
});
3 changes: 3 additions & 0 deletions src/analytics/platforms/platforms.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ angular.module("ovh-api-services").service("OvhApiAnalyticsPlatforms", function
return {
v6: function () {
return $injector.get("OvhApiAnalyticsPlatformsV6");
},
Node: function () {
return $injector.get("OvhApiAnalyticsPlatformsNode");
}
};
});
9 changes: 1 addition & 8 deletions src/analytics/platforms/platforms.v6.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,10 @@ angular.module("ovh-api-services").service("OvhApiAnalyticsPlatformsV6", functio
isArray: true,
cache: cache
},
getNodes: {
url: "/analytics/platforms/:serviceName/nodes",
method: "GET",
isArray: true,
cache: cache
},
getStatus: {
url: "/analytics/platforms/:serviceName/status",
method: "GET",
isArray: true,
cache: cache
isArray: true
}
});

Expand Down

0 comments on commit d1670cd

Please sign in to comment.