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

Feat/data processing #286

Merged
merged 3 commits into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/api/cloud/project/cloud-project.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ angular.module('ovh-api-services').service('OvhApiCloudProject', ($injector, $ca
Acl() {
return $injector.get('OvhApiCloudProjectAcl');
},
Dataprocessing() {
Hugoch marked this conversation as resolved.
Show resolved Hide resolved
return $injector.get('OvhApiCloudProjectDataProcessing');
},
Ai() {
return $injector.get('OvhApiCloudProjectAi');
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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: [],
antleblanc marked this conversation as resolved.
Show resolved Hide resolved
},
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
angular
.module('ovh-api-services')
.service('OvhApiCloudProjectDataProcessingAuthorization', ($injector) => ({
iceberg: () => $injector.get('OvhApiCloudProjectDataProcessingAuthorizationIceberg'),
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
angular
.module('ovh-api-services')
.service('OvhApiCloudProjectDataProcessingCapabilitiesIceberg', (iceberg) => iceberg('/cloud/project/:serviceName/dataProcessing/capabilities', {
serviceName: '@serviceName',
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
angular
.module('ovh-api-services')
.service('OvhApiCloudProjectDataProcessingCapabilities', ($injector) => ({
iceberg: () => $injector.get('OvhApiCloudProjectDataProcessingCapabilitiesIceberg'),
}));
Original file line number Diff line number Diff line change
@@ -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'),
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
angular
.module('ovh-api-services')
.service('OvhApiCloudProjectDataProcessingV6', ($resource) => $resource('/cloud/project/:serviceName/dataprocessing', {
Hugoch marked this conversation as resolved.
Show resolved Hide resolved
serviceName: '@serviceName',
}));
Original file line number Diff line number Diff line change
@@ -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: [],
antleblanc marked this conversation as resolved.
Show resolved Hide resolved
},
logs: {
method: 'GET',
url: '/cloud/project/:serviceName/dataProcessing/jobs/:jobId/logs',
},
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
angular
.module('ovh-api-services')
.service('OvhApiCloudProjectDataProcessingJobs', ($injector) => ({
iceberg: () => $injector.get('OvhApiCloudProjectDataProcessingJobsIceberg'),
}));
Original file line number Diff line number Diff line change
@@ -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,
},
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
angular
.module('ovh-api-services')
.service('OvhApiCloudProjectDataProcessingMetrics', ($injector) => ({
iceberg: () => $injector.get('OvhApiCloudProjectDataProcessingMetricsIceberg'),
}));