1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-12 09:17:41 +03:00

B #3951: fix oneflow routes (#190)

Signed-off-by: Jorge Lobo <jlobo@opennebula.io>

Co-authored-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
Jorge Miguel Lobo Escalona 2020-09-08 16:15:13 +02:00 committed by GitHub
parent 5b9d2a6f48
commit 75b90fb438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 12 deletions

View File

@ -29,55 +29,69 @@ const {
serviceTemplateAction
} = require('./service_template');
const { httpMethod } = require('../../../../utils/constants/defaults');
const {
SERVICE_ALL,
SERVICE,
SERVICE_DELETE,
SERVICE_ADD_ACTION,
SERVICE_ADD_SCALE,
SERVICE_ADD_ROLE_ACTION,
SERVICE_TEMPLATE_ALL,
SERVICE_TEMPLATE,
SERVICE_TEMPLATE_DELETE,
SERVICE_TEMPLATE_CREATE,
SERVICE_TEMPLATE_UPDATE,
SERVICE_TEMPLATE_ACTION
} = require('./oneflow-routes');
const { GET, POST, DELETE, PUT } = httpMethod;
const privateRoutes = {
'service-all': {
[SERVICE_ALL]: {
httpMethod: GET,
action: serviceAll
},
service: {
[SERVICE]: {
httpMethod: GET,
action: service
},
'service-delete': {
[SERVICE_DELETE]: {
httpMethod: DELETE,
action: serviceDelete
},
'service-add-action': {
[SERVICE_ADD_ACTION]: {
httpMethod: POST,
action: serviceAddAction
},
'service-add-scale': {
[SERVICE_ADD_SCALE]: {
httpMethod: POST,
action: serviceAddScale
},
'service-add-role-action': {
[SERVICE_ADD_ROLE_ACTION]: {
httpMethod: POST,
action: serviceAddRoleAction
},
'service_template-all': {
[SERVICE_TEMPLATE_ALL]: {
httpMethod: GET,
action: serviceTemplateAll
},
service_template: {
[SERVICE_TEMPLATE]: {
httpMethod: GET,
action: serviceTemplate
},
'service_template-delete': {
[SERVICE_TEMPLATE_DELETE]: {
httpMethod: DELETE,
action: serviceTemplateDelete
},
'service_template-create': {
[SERVICE_TEMPLATE_CREATE]: {
httpMethod: POST,
action: serviceTemplateCreate
},
'service_template-update': {
[SERVICE_TEMPLATE_UPDATE]: {
httpMethod: PUT,
action: serviceTemplateUpdate
},
'service_template-action': {
[SERVICE_TEMPLATE_ACTION]: {
httpMethod: POST,
action: serviceTemplateAction
}

View File

@ -0,0 +1,29 @@
const SERVICE_ALL = 'service-all';
const SERVICE = 'service';
const SERVICE_DELETE = 'service-delete';
const SERVICE_ADD_ACTION = 'service-add-action';
const SERVICE_ADD_SCALE = 'service-add-scale';
const SERVICE_ADD_ROLE_ACTION = 'service-add-role-action';
const SERVICE_TEMPLATE_ALL = 'service_template-all';
const SERVICE_TEMPLATE = 'service_template';
const SERVICE_TEMPLATE_DELETE = 'service_template-delete';
const SERVICE_TEMPLATE_CREATE = 'service_template-create';
const SERVICE_TEMPLATE_UPDATE = 'service_template-update';
const SERVICE_TEMPLATE_ACTION = 'service_template-action';
const Actions = {
SERVICE_ALL,
SERVICE,
SERVICE_DELETE,
SERVICE_ADD_ACTION,
SERVICE_ADD_SCALE,
SERVICE_ADD_ROLE_ACTION,
SERVICE_TEMPLATE_ALL,
SERVICE_TEMPLATE,
SERVICE_TEMPLATE_DELETE,
SERVICE_TEMPLATE_CREATE,
SERVICE_TEMPLATE_UPDATE,
SERVICE_TEMPLATE_ACTION
};
module.exports = Actions;