From a53f50de12e1bbc3f5729dde6137361d47552143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20DE=20CESARE?= Date: Mon, 1 Oct 2018 10:04:45 +0200 Subject: [PATCH] feat(dedicated.cloud): add VM encryption KMS routes --- .../dedicatedCloud-vmEncryption.v6.service.js | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/dedicatedCloud/vmEncryption/kms/dedicatedCloud-vmEncryption.v6.service.js b/src/dedicatedCloud/vmEncryption/kms/dedicatedCloud-vmEncryption.v6.service.js index faf3584f..92f293d3 100644 --- a/src/dedicatedCloud/vmEncryption/kms/dedicatedCloud-vmEncryption.v6.service.js +++ b/src/dedicatedCloud/vmEncryption/kms/dedicatedCloud-vmEncryption.v6.service.js @@ -3,13 +3,41 @@ angular.module("ovh-api-services").service("OvhApiDedicatedCloudVMEncryptionKmsV var queryCache = $cacheFactory("OvhApiDedicatedCloudVMEncryptionKmsV6Query"); var cache = $cacheFactory("OvhApiDedicatedCloudVMEncryptionKmsV6"); + var interceptor = function (response) { + cache.remove(response.config.url); + queryCache.removeAll(); + return response; + }; var kmsResource = $resource("/dedicatedCloud/:serviceName/vmEncryption/kms/:kmsId", { serviceName: "@serviceName", kmsId: "@kmsId" }, { query: { method: "GET", cache: queryCache, isArray: true }, - get: { method: "GET", cache: cache } + get: { method: "GET", cache: cache }, + create: { + method: "POST", + url: "/dedicatedCloud/:serviceName/vmEncryption/kms", + params: { + ip: "@ip", + description: "@description", + sslThumbprint: "@sslThumbprint" + }, + interceptor: interceptor + }, + changeProperties: { + method: "POST", + url: "/dedicatedCloud/:serviceName/vmEncryption/kms/:kmsId/changeProperties", + params: { + description: "@description", + sslThumbprint: "@sslThumbprint" + }, + interceptor: interceptor + }, + "delete": { + method: "DELETE", + interceptor: interceptor + } }); kmsResource.resetQueryCache = function () {