diff --git a/src/auth/auth.v6.service.js b/src/auth/auth.v6.service.js index 6214c71a..662b07dc 100644 --- a/src/auth/auth.v6.service.js +++ b/src/auth/auth.v6.service.js @@ -1,4 +1,4 @@ -angular.module("ovh-api-services").service("OvhApiAuthV6", function ($resource) { +angular.module("ovh-api-services").service("OvhApiAuthV6", function ($resource, $http) { "use strict"; return $resource( @@ -8,6 +8,21 @@ angular.module("ovh-api-services").service("OvhApiAuthV6", function ($resource) url: "/auth/logout", method: "POST", isArray: false + }, + time: { + url: "/auth/time", + method: "GET", + isArray: false, + transformResponse: $http.defaults.transformResponse.concat(function (raw, headers, status) { + var result = {}; + if (status === 403) { + result.value = false; + result.message = raw.message; + } else { + result.value = raw; + } + return result; + }) } } ); diff --git a/src/cloud/project/cloud-project.service.js b/src/cloud/project/cloud-project.service.js index 7f0422f1..d308b693 100644 --- a/src/cloud/project/cloud-project.service.js +++ b/src/cloud/project/cloud-project.service.js @@ -54,6 +54,9 @@ angular.module("ovh-api-services").service("OvhApiCloudProject", function ($inje }, Stack: function () { return $injector.get("OvhApiCloudProjectStack"); + }, + Volume: function () { + return $injector.get("OvhApiCloudProjectVolume"); } }; diff --git a/src/me/me.v6.service.js b/src/me/me.v6.service.js index 2dfb92f8..216849ad 100644 --- a/src/me/me.v6.service.js +++ b/src/me/me.v6.service.js @@ -13,7 +13,17 @@ angular.module("ovh-api-services").service("OvhApiMeV6", function ($resource, $c var me = $resource("/me", {}, { get: { method: "GET", cache: cache }, update: { method: "PUT", interceptor: interceptor }, - schema: { method: "GET", url: "/me.json" } + schema: { method: "GET", url: "/me.json" }, + consumption: { + method: "GET", + url: "/me/consumption/usage/current", + isArray: true + }, + consumptionHistory: { + method: "GET", + url: "/me/consumption/usage/history", + isArray: true + } }); me.resetCache = function () { diff --git a/src/services/services.service.js b/src/services/services.service.js index 5d933d53..97129f4b 100644 --- a/src/services/services.service.js +++ b/src/services/services.service.js @@ -3,6 +3,9 @@ angular.module("ovh-api-services").service("OvhApiServices", function ($injector return { Aapi: function () { return $injector.get("OvhApiServicesAapi"); + }, + v6: function () { + return $injector.get("OvhApiServicesV6"); } }; }); diff --git a/src/services/services.v6.service.js b/src/services/services.v6.service.js new file mode 100644 index 00000000..04e60682 --- /dev/null +++ b/src/services/services.v6.service.js @@ -0,0 +1,8 @@ +angular.module("ovh-api-services").service("OvhApiServicesV6", function ($resource) { + "use strict"; + + return $resource("/services/:serviceId", { + serviceId: "@serviceId" + }); + +});