diff options
| author | jc0b <j@jc0b.computer> | 2020-07-07 16:55:22 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:51 +0200 |
| commit | 223e916997eb641a1662110b6de630a4cdfdf479 (patch) | |
| tree | 90ca4364461f676db45f25e03d8f22fc32f9fdd8 /frontend/src/api/routes | |
| parent | 9ff1e3c6bae253372a468dbdc9b8369ab8dd2c6f (diff) | |
| parent | b810c4413079bf5aeb5374f1cd20e151a83530d0 (diff) | |
Merge branch 'feature/mongodb-migration' of github.com:atlarge-research/opendc-dev into feature/mongodb-migration
Diffstat (limited to 'frontend/src/api/routes')
| -rw-r--r-- | frontend/src/api/routes/experiments.js | 20 | ||||
| -rw-r--r-- | frontend/src/api/routes/projects.js (renamed from frontend/src/api/routes/simulations.js) | 28 | ||||
| -rw-r--r-- | frontend/src/api/routes/topologies.js | 4 |
3 files changed, 19 insertions, 33 deletions
diff --git a/frontend/src/api/routes/experiments.js b/frontend/src/api/routes/experiments.js index ab85613c..acc72f34 100644 --- a/frontend/src/api/routes/experiments.js +++ b/frontend/src/api/routes/experiments.js @@ -1,16 +1,16 @@ import { deleteById, getById } from './util' import { sendRequest } from '../index' -export function addExperiment(simulationId, experiment) { +export function addExperiment(projectId, experiment) { return sendRequest({ - path: '/simulations/{simulationId}/experiments', + path: '/projects/{projectId}/experiments', method: 'POST', parameters: { body: { experiment, }, path: { - simulationId, + projectId, }, query: {}, }, @@ -24,17 +24,3 @@ export function getExperiment(experimentId) { export function deleteExperiment(experimentId) { return deleteById('/experiments/{experimentId}', { experimentId }) } - -export function getAllMachineStates(experimentId) { - return getById('/experiments/{experimentId}/machine-states', { - experimentId, - }) -} - -export function getAllRackStates(experimentId) { - return getById('/experiments/{experimentId}/rack-states', { experimentId }) -} - -export function getAllRoomStates(experimentId) { - return getById('/experiments/{experimentId}/room-states', { experimentId }) -} diff --git a/frontend/src/api/routes/simulations.js b/frontend/src/api/routes/projects.js index e22fbc07..a261adb8 100644 --- a/frontend/src/api/routes/simulations.js +++ b/frontend/src/api/routes/projects.js @@ -1,17 +1,17 @@ import { sendRequest } from '../index' import { deleteById, getById } from './util' -export function getSimulation(simulationId) { - return getById('/simulations/{simulationId}', { simulationId }) +export function getProject(projectId) { + return getById('/projects/{projectId}', { projectId }) } -export function addSimulation(simulation) { +export function addProject(project) { return sendRequest({ - path: '/simulations', + path: '/projects', method: 'POST', parameters: { body: { - simulation, + project, }, path: {}, query: {}, @@ -19,36 +19,36 @@ export function addSimulation(simulation) { }) } -export function updateSimulation(simulation) { +export function updateProject(project) { return sendRequest({ - path: '/simulations/{simulationId}', + path: '/projects/{projectId}', method: 'PUT', parameters: { body: { - simulation, + project, }, path: { - simulationId: simulation._id, + projectId: project._id, }, query: {}, }, }) } -export function deleteSimulation(simulationId) { - return deleteById('/simulations/{simulationId}', { simulationId }) +export function deleteProject(projectId) { + return deleteById('/projects/{projectId}', { projectId }) } -export function addExperiment(simulationId, experiment) { +export function addExperiment(projectId, experiment) { return sendRequest({ - path: '/simulations/{simulationId}/experiments', + path: '/projects/{projectId}/experiments', method: 'POST', parameters: { body: { experiment, }, path: { - simulationId, + projectId, }, query: {}, }, diff --git a/frontend/src/api/routes/topologies.js b/frontend/src/api/routes/topologies.js index 307ea7ab..a8f0d6b1 100644 --- a/frontend/src/api/routes/topologies.js +++ b/frontend/src/api/routes/topologies.js @@ -3,14 +3,14 @@ import { sendRequest } from '../index' export function addTopology(topology) { return sendRequest({ - path: '/simulations/{simulationId}/topologies', + path: '/projects/{projectId}/topologies', method: 'POST', parameters: { body: { topology, }, path: { - simulationId: topology.simulationId, + projectId: topology.projectId, }, query: {}, }, |
