diff --git a/src/api/cloud/project/cloud-project.service.js b/src/api/cloud/project/cloud-project.service.js index 638ab0d8..62329fbf 100644 --- a/src/api/cloud/project/cloud-project.service.js +++ b/src/api/cloud/project/cloud-project.service.js @@ -10,6 +10,9 @@ angular.module('ovh-api-services').service('OvhApiCloudProject', ($injector, $ca Acl() { return $injector.get('OvhApiCloudProjectAcl'); }, + DataProcessing() { + return $injector.get('OvhApiCloudProjectDataProcessing'); + }, Ai() { return $injector.get('OvhApiCloudProjectAi'); }, diff --git a/src/api/cloud/project/dataprocessing/authorization/cloud-project-dataprocessing-authorization.iceberg.service.js b/src/api/cloud/project/dataprocessing/authorization/cloud-project-dataprocessing-authorization.iceberg.service.js new file mode 100644 index 00000000..947bc681 --- /dev/null +++ b/src/api/cloud/project/dataprocessing/authorization/cloud-project-dataprocessing-authorization.iceberg.service.js @@ -0,0 +1,23 @@ +/** + * Interceptor purges serviceName from POST payload + * @type {{request(*): *}} + */ +const postInterceptor = { + request(req) { + req.data = null; + return req; + }, +}; + +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingAuthorizationIceberg', (iceberg) => iceberg('/cloud/project/:serviceName/dataProcessing/authorization', { + serviceName: '@serviceName', + }, { + post: { + method: 'POST', + url: '/cloud/project/:serviceName/dataProcessing/authorization', + interceptor: postInterceptor, + transformResponse: [], + }, + })); diff --git a/src/api/cloud/project/dataprocessing/authorization/cloud-project-dataprocessing-authorization.service.js b/src/api/cloud/project/dataprocessing/authorization/cloud-project-dataprocessing-authorization.service.js new file mode 100644 index 00000000..fca01000 --- /dev/null +++ b/src/api/cloud/project/dataprocessing/authorization/cloud-project-dataprocessing-authorization.service.js @@ -0,0 +1,5 @@ +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingAuthorization', ($injector) => ({ + iceberg: () => $injector.get('OvhApiCloudProjectDataProcessingAuthorizationIceberg'), + })); diff --git a/src/api/cloud/project/dataprocessing/capabilities/cloud-project-dataprocessing-capabilities.iceberg.service.js b/src/api/cloud/project/dataprocessing/capabilities/cloud-project-dataprocessing-capabilities.iceberg.service.js new file mode 100644 index 00000000..d370811b --- /dev/null +++ b/src/api/cloud/project/dataprocessing/capabilities/cloud-project-dataprocessing-capabilities.iceberg.service.js @@ -0,0 +1,5 @@ +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingCapabilitiesIceberg', (iceberg) => iceberg('/cloud/project/:serviceName/dataProcessing/capabilities', { + serviceName: '@serviceName', + })); diff --git a/src/api/cloud/project/dataprocessing/capabilities/cloud-project-dataprocessing-capabilities.service.js b/src/api/cloud/project/dataprocessing/capabilities/cloud-project-dataprocessing-capabilities.service.js new file mode 100644 index 00000000..d3128bf9 --- /dev/null +++ b/src/api/cloud/project/dataprocessing/capabilities/cloud-project-dataprocessing-capabilities.service.js @@ -0,0 +1,5 @@ +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingCapabilities', ($injector) => ({ + iceberg: () => $injector.get('OvhApiCloudProjectDataProcessingCapabilitiesIceberg'), + })); diff --git a/src/api/cloud/project/dataprocessing/cloud-project-dataprocessing.service.js b/src/api/cloud/project/dataprocessing/cloud-project-dataprocessing.service.js new file mode 100644 index 00000000..95267b15 --- /dev/null +++ b/src/api/cloud/project/dataprocessing/cloud-project-dataprocessing.service.js @@ -0,0 +1,9 @@ +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessing', ($injector) => ({ + v6: () => $injector.get('OvhApiCloudProjectDataProcessingV6'), + Capabilities: () => $injector.get('OvhApiCloudProjectDataProcessingCapabilities'), + Authorization: () => $injector.get('OvhApiCloudProjectDataProcessingAuthorization'), + Jobs: () => $injector.get('OvhApiCloudProjectDataProcessingJobs'), + Metrics: () => $injector.get('OvhApiCloudProjectDataProcessingMetrics'), + })); diff --git a/src/api/cloud/project/dataprocessing/cloud-project-dataprocessing.v6.service.js b/src/api/cloud/project/dataprocessing/cloud-project-dataprocessing.v6.service.js new file mode 100644 index 00000000..7b29c087 --- /dev/null +++ b/src/api/cloud/project/dataprocessing/cloud-project-dataprocessing.v6.service.js @@ -0,0 +1,5 @@ +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingV6', ($resource) => $resource('/cloud/project/:serviceName/dataProcessing', { + serviceName: '@serviceName', + })); diff --git a/src/api/cloud/project/dataprocessing/jobs/cloud-project-dataprocessing-jobs.iceberg.service.js b/src/api/cloud/project/dataprocessing/jobs/cloud-project-dataprocessing-jobs.iceberg.service.js new file mode 100644 index 00000000..6aed2f86 --- /dev/null +++ b/src/api/cloud/project/dataprocessing/jobs/cloud-project-dataprocessing-jobs.iceberg.service.js @@ -0,0 +1,32 @@ +/** + * Interceptor purges serviceName from POST payload + * @type {{request(*): *}} + */ +const postInterceptor = { + request(req) { + delete req.data.serviceName; + return req; + }, +}; + +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingJobsIceberg', (iceberg) => iceberg('/cloud/project/:serviceName/dataProcessing/jobs/:jobId', { + serviceName: '@serviceName', + jobId: '@jobId', + }, { + post: { + method: 'POST', + url: '/cloud/project/:serviceName/dataProcessing/jobs', + interceptor: postInterceptor, + }, + delete: { + method: 'DELETE', + url: '/cloud/project/:serviceName/dataProcessing/jobs/:jobId', + transformResponse: [], + }, + logs: { + method: 'GET', + url: '/cloud/project/:serviceName/dataProcessing/jobs/:jobId/logs', + }, + })); diff --git a/src/api/cloud/project/dataprocessing/jobs/cloud-project-dataprocessing-jobs.service.js b/src/api/cloud/project/dataprocessing/jobs/cloud-project-dataprocessing-jobs.service.js new file mode 100644 index 00000000..572a4758 --- /dev/null +++ b/src/api/cloud/project/dataprocessing/jobs/cloud-project-dataprocessing-jobs.service.js @@ -0,0 +1,5 @@ +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingJobs', ($injector) => ({ + iceberg: () => $injector.get('OvhApiCloudProjectDataProcessingJobsIceberg'), + })); diff --git a/src/api/cloud/project/dataprocessing/metrics/cloud-project-dataprocessing-metrics.iceberg.service.js b/src/api/cloud/project/dataprocessing/metrics/cloud-project-dataprocessing-metrics.iceberg.service.js new file mode 100644 index 00000000..39cdfd7f --- /dev/null +++ b/src/api/cloud/project/dataprocessing/metrics/cloud-project-dataprocessing-metrics.iceberg.service.js @@ -0,0 +1,13 @@ +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingMetricsIceberg', (iceberg, $cacheFactory) => { + const queryCache = $cacheFactory('OvhApiDataprocessingIcebergQuery'); + return iceberg('/cloud/project/:serviceName/dataProcessing/metrics', { + serviceName: '@serviceName', + }, { + query: { + method: 'GET', + cache: queryCache, + }, + }); + }); diff --git a/src/api/cloud/project/dataprocessing/metrics/cloud-project-dataprocessing-metrics.service.js b/src/api/cloud/project/dataprocessing/metrics/cloud-project-dataprocessing-metrics.service.js new file mode 100644 index 00000000..6a986b4e --- /dev/null +++ b/src/api/cloud/project/dataprocessing/metrics/cloud-project-dataprocessing-metrics.service.js @@ -0,0 +1,5 @@ +angular + .module('ovh-api-services') + .service('OvhApiCloudProjectDataProcessingMetrics', ($injector) => ({ + iceberg: () => $injector.get('OvhApiCloudProjectDataProcessingMetricsIceberg'), + }));