Skip to content
Snippets Groups Projects
Commit b0e6d484 authored by Jan Müller's avatar Jan Müller
Browse files

Update Api

parent d692548f
No related branches found
No related tags found
No related merge requests found
...@@ -6,5 +6,8 @@ from __future__ import absolute_import ...@@ -6,5 +6,8 @@ from __future__ import absolute_import
from access_node.models.attribute import Attribute from access_node.models.attribute import Attribute
from access_node.models.data import Data from access_node.models.data import Data
from access_node.models.error import Error from access_node.models.error import Error
from access_node.models.info import Info
from access_node.models.multimeter import Multimeter
from access_node.models.multimeter_info import MultimeterInfo
from access_node.models.precision import Precision from access_node.models.precision import Precision
from access_node.models.spikes import Spikes from access_node.models.spikes import Spikes
...@@ -6,6 +6,7 @@ from datetime import date, datetime # noqa: F401 ...@@ -6,6 +6,7 @@ from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401 from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model from access_node.models.base_model_ import Model
from access_node.models.multimeter import Multimeter # noqa: F401,E501
from access_node import util from access_node import util
...@@ -15,36 +16,21 @@ class Data(Model): ...@@ -15,36 +16,21 @@ class Data(Model):
Do not edit the class manually. Do not edit the class manually.
""" """
def __init__(self, first_simulation_step: float=None, num_simulation_steps: float=None, neuron_ids: List[float]=None, values: List[List[float]]=None): # noqa: E501 def __init__(self, multimeters: List[Multimeter]=None): # noqa: E501
"""Data - a model defined in Swagger """Data - a model defined in Swagger
:param first_simulation_step: The first_simulation_step of this Data. # noqa: E501 :param multimeters: The multimeters of this Data. # noqa: E501
:type first_simulation_step: float :type multimeters: List[Multimeter]
:param num_simulation_steps: The num_simulation_steps of this Data. # noqa: E501
:type num_simulation_steps: float
:param neuron_ids: The neuron_ids of this Data. # noqa: E501
:type neuron_ids: List[float]
:param values: The values of this Data. # noqa: E501
:type values: List[List[float]]
""" """
self.swagger_types = { self.swagger_types = {
'first_simulation_step': float, 'multimeters': List[Multimeter]
'num_simulation_steps': float,
'neuron_ids': List[float],
'values': List[List[float]]
} }
self.attribute_map = { self.attribute_map = {
'first_simulation_step': 'first_simulation_step', 'multimeters': 'multimeters'
'num_simulation_steps': 'num_simulation_steps',
'neuron_ids': 'neuron_ids',
'values': 'values'
} }
self._first_simulation_step = first_simulation_step self._multimeters = multimeters
self._num_simulation_steps = num_simulation_steps
self._neuron_ids = neuron_ids
self._values = values
@classmethod @classmethod
def from_dict(cls, dikt) -> 'Data': def from_dict(cls, dikt) -> 'Data':
...@@ -58,85 +44,22 @@ class Data(Model): ...@@ -58,85 +44,22 @@ class Data(Model):
return util.deserialize_model(dikt, cls) return util.deserialize_model(dikt, cls)
@property @property
def first_simulation_step(self) -> float: def multimeters(self) -> List[Multimeter]:
"""Gets the first_simulation_step of this Data. """Gets the multimeters of this Data.
:return: The first_simulation_step of this Data. :return: The multimeters of this Data.
:rtype: float :rtype: List[Multimeter]
""" """
return self._first_simulation_step return self._multimeters
@first_simulation_step.setter @multimeters.setter
def first_simulation_step(self, first_simulation_step: float): def multimeters(self, multimeters: List[Multimeter]):
"""Sets the first_simulation_step of this Data. """Sets the multimeters of this Data.
:param first_simulation_step: The first_simulation_step of this Data. :param multimeters: The multimeters of this Data.
:type first_simulation_step: float :type multimeters: List[Multimeter]
""" """
self._first_simulation_step = first_simulation_step self._multimeters = multimeters
@property
def num_simulation_steps(self) -> float:
"""Gets the num_simulation_steps of this Data.
:return: The num_simulation_steps of this Data.
:rtype: float
"""
return self._num_simulation_steps
@num_simulation_steps.setter
def num_simulation_steps(self, num_simulation_steps: float):
"""Sets the num_simulation_steps of this Data.
:param num_simulation_steps: The num_simulation_steps of this Data.
:type num_simulation_steps: float
"""
self._num_simulation_steps = num_simulation_steps
@property
def neuron_ids(self) -> List[float]:
"""Gets the neuron_ids of this Data.
:return: The neuron_ids of this Data.
:rtype: List[float]
"""
return self._neuron_ids
@neuron_ids.setter
def neuron_ids(self, neuron_ids: List[float]):
"""Sets the neuron_ids of this Data.
:param neuron_ids: The neuron_ids of this Data.
:type neuron_ids: List[float]
"""
self._neuron_ids = neuron_ids
@property
def values(self) -> List[List[float]]:
"""Gets the values of this Data.
:return: The values of this Data.
:rtype: List[List[float]]
"""
return self._values
@values.setter
def values(self, values: List[List[float]]):
"""Sets the values of this Data.
:param values: The values of this Data.
:type values: List[List[float]]
"""
self._values = values
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node.models.multimeter_info import MultimeterInfo # noqa: F401,E501
from access_node import util
class Info(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, simulation_resolution: float=None, multimeters: List[MultimeterInfo]=None): # noqa: E501
"""Info - a model defined in Swagger
:param simulation_resolution: The simulation_resolution of this Info. # noqa: E501
:type simulation_resolution: float
:param multimeters: The multimeters of this Info. # noqa: E501
:type multimeters: List[MultimeterInfo]
"""
self.swagger_types = {
'simulation_resolution': float,
'multimeters': List[MultimeterInfo]
}
self.attribute_map = {
'simulation_resolution': 'simulation_resolution',
'multimeters': 'multimeters'
}
self._simulation_resolution = simulation_resolution
self._multimeters = multimeters
@classmethod
def from_dict(cls, dikt) -> 'Info':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The Info of this Info. # noqa: E501
:rtype: Info
"""
return util.deserialize_model(dikt, cls)
@property
def simulation_resolution(self) -> float:
"""Gets the simulation_resolution of this Info.
:return: The simulation_resolution of this Info.
:rtype: float
"""
return self._simulation_resolution
@simulation_resolution.setter
def simulation_resolution(self, simulation_resolution: float):
"""Sets the simulation_resolution of this Info.
:param simulation_resolution: The simulation_resolution of this Info.
:type simulation_resolution: float
"""
self._simulation_resolution = simulation_resolution
@property
def multimeters(self) -> List[MultimeterInfo]:
"""Gets the multimeters of this Info.
:return: The multimeters of this Info.
:rtype: List[MultimeterInfo]
"""
return self._multimeters
@multimeters.setter
def multimeters(self, multimeters: List[MultimeterInfo]):
"""Sets the multimeters of this Info.
:param multimeters: The multimeters of this Info.
:type multimeters: List[MultimeterInfo]
"""
self._multimeters = multimeters
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node.models.attribute import Attribute # noqa: F401,E501
from access_node import util
class Multimeter(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, name: str=None, interval: float=None, attribute: Attribute=None, measurement_times: List[float]=None, _from: float=None, to: float=None, neuron_ids: List[float]=None, values: List[List[float]]=None): # noqa: E501
"""Multimeter - a model defined in Swagger
:param name: The name of this Multimeter. # noqa: E501
:type name: str
:param interval: The interval of this Multimeter. # noqa: E501
:type interval: float
:param attribute: The attribute of this Multimeter. # noqa: E501
:type attribute: Attribute
:param measurement_times: The measurement_times of this Multimeter. # noqa: E501
:type measurement_times: List[float]
:param _from: The _from of this Multimeter. # noqa: E501
:type _from: float
:param to: The to of this Multimeter. # noqa: E501
:type to: float
:param neuron_ids: The neuron_ids of this Multimeter. # noqa: E501
:type neuron_ids: List[float]
:param values: The values of this Multimeter. # noqa: E501
:type values: List[List[float]]
"""
self.swagger_types = {
'name': str,
'interval': float,
'attribute': Attribute,
'measurement_times': List[float],
'_from': float,
'to': float,
'neuron_ids': List[float],
'values': List[List[float]]
}
self.attribute_map = {
'name': 'name',
'interval': 'interval',
'attribute': 'attribute',
'measurement_times': 'measurement_times',
'_from': 'from',
'to': 'to',
'neuron_ids': 'neuron_ids',
'values': 'values'
}
self._name = name
self._interval = interval
self._attribute = attribute
self._measurement_times = measurement_times
self.__from = _from
self._to = to
self._neuron_ids = neuron_ids
self._values = values
@classmethod
def from_dict(cls, dikt) -> 'Multimeter':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The Multimeter of this Multimeter. # noqa: E501
:rtype: Multimeter
"""
return util.deserialize_model(dikt, cls)
@property
def name(self) -> str:
"""Gets the name of this Multimeter.
:return: The name of this Multimeter.
:rtype: str
"""
return self._name
@name.setter
def name(self, name: str):
"""Sets the name of this Multimeter.
:param name: The name of this Multimeter.
:type name: str
"""
self._name = name
@property
def interval(self) -> float:
"""Gets the interval of this Multimeter.
:return: The interval of this Multimeter.
:rtype: float
"""
return self._interval
@interval.setter
def interval(self, interval: float):
"""Sets the interval of this Multimeter.
:param interval: The interval of this Multimeter.
:type interval: float
"""
self._interval = interval
@property
def attribute(self) -> Attribute:
"""Gets the attribute of this Multimeter.
:return: The attribute of this Multimeter.
:rtype: Attribute
"""
return self._attribute
@attribute.setter
def attribute(self, attribute: Attribute):
"""Sets the attribute of this Multimeter.
:param attribute: The attribute of this Multimeter.
:type attribute: Attribute
"""
self._attribute = attribute
@property
def measurement_times(self) -> List[float]:
"""Gets the measurement_times of this Multimeter.
:return: The measurement_times of this Multimeter.
:rtype: List[float]
"""
return self._measurement_times
@measurement_times.setter
def measurement_times(self, measurement_times: List[float]):
"""Sets the measurement_times of this Multimeter.
:param measurement_times: The measurement_times of this Multimeter.
:type measurement_times: List[float]
"""
self._measurement_times = measurement_times
@property
def _from(self) -> float:
"""Gets the _from of this Multimeter.
:return: The _from of this Multimeter.
:rtype: float
"""
return self.__from
@_from.setter
def _from(self, _from: float):
"""Sets the _from of this Multimeter.
:param _from: The _from of this Multimeter.
:type _from: float
"""
self.__from = _from
@property
def to(self) -> float:
"""Gets the to of this Multimeter.
:return: The to of this Multimeter.
:rtype: float
"""
return self._to
@to.setter
def to(self, to: float):
"""Sets the to of this Multimeter.
:param to: The to of this Multimeter.
:type to: float
"""
self._to = to
@property
def neuron_ids(self) -> List[float]:
"""Gets the neuron_ids of this Multimeter.
:return: The neuron_ids of this Multimeter.
:rtype: List[float]
"""
return self._neuron_ids
@neuron_ids.setter
def neuron_ids(self, neuron_ids: List[float]):
"""Sets the neuron_ids of this Multimeter.
:param neuron_ids: The neuron_ids of this Multimeter.
:type neuron_ids: List[float]
"""
self._neuron_ids = neuron_ids
@property
def values(self) -> List[List[float]]:
"""Gets the values of this Multimeter.
:return: The values of this Multimeter.
:rtype: List[List[float]]
"""
return self._values
@values.setter
def values(self, values: List[List[float]]):
"""Sets the values of this Multimeter.
:param values: The values of this Multimeter.
:type values: List[List[float]]
"""
self._values = values
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from access_node.models.base_model_ import Model
from access_node.models.attribute import Attribute # noqa: F401,E501
from access_node import util
class MultimeterInfo(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, name: str=None, interval: float=None, attributes: List[Attribute]=None): # noqa: E501
"""MultimeterInfo - a model defined in Swagger
:param name: The name of this MultimeterInfo. # noqa: E501
:type name: str
:param interval: The interval of this MultimeterInfo. # noqa: E501
:type interval: float
:param attributes: The attributes of this MultimeterInfo. # noqa: E501
:type attributes: List[Attribute]
"""
self.swagger_types = {
'name': str,
'interval': float,
'attributes': List[Attribute]
}
self.attribute_map = {
'name': 'name',
'interval': 'interval',
'attributes': 'attributes'
}
self._name = name
self._interval = interval
self._attributes = attributes
@classmethod
def from_dict(cls, dikt) -> 'MultimeterInfo':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The MultimeterInfo of this MultimeterInfo. # noqa: E501
:rtype: MultimeterInfo
"""
return util.deserialize_model(dikt, cls)
@property
def name(self) -> str:
"""Gets the name of this MultimeterInfo.
:return: The name of this MultimeterInfo.
:rtype: str
"""
return self._name
@name.setter
def name(self, name: str):
"""Sets the name of this MultimeterInfo.
:param name: The name of this MultimeterInfo.
:type name: str
"""
self._name = name
@property
def interval(self) -> float:
"""Gets the interval of this MultimeterInfo.
:return: The interval of this MultimeterInfo.
:rtype: float
"""
return self._interval
@interval.setter
def interval(self, interval: float):
"""Sets the interval of this MultimeterInfo.
:param interval: The interval of this MultimeterInfo.
:type interval: float
"""
self._interval = interval
@property
def attributes(self) -> List[Attribute]:
"""Gets the attributes of this MultimeterInfo.
:return: The attributes of this MultimeterInfo.
:rtype: List[Attribute]
"""
return self._attributes
@attributes.setter
def attributes(self, attributes: List[Attribute]):
"""Sets the attributes of this MultimeterInfo.
:param attributes: The attributes of this MultimeterInfo.
:type attributes: List[Attribute]
"""
self._attributes = attributes
...@@ -15,25 +15,25 @@ class Spikes(Model): ...@@ -15,25 +15,25 @@ class Spikes(Model):
Do not edit the class manually. Do not edit the class manually.
""" """
def __init__(self, simulation_steps: List[float]=None, neuron_ids: List[float]=None): # noqa: E501 def __init__(self, simulation_times: List[float]=None, neuron_ids: List[float]=None): # noqa: E501
"""Spikes - a model defined in Swagger """Spikes - a model defined in Swagger
:param simulation_steps: The simulation_steps of this Spikes. # noqa: E501 :param simulation_times: The simulation_times of this Spikes. # noqa: E501
:type simulation_steps: List[float] :type simulation_times: List[float]
:param neuron_ids: The neuron_ids of this Spikes. # noqa: E501 :param neuron_ids: The neuron_ids of this Spikes. # noqa: E501
:type neuron_ids: List[float] :type neuron_ids: List[float]
""" """
self.swagger_types = { self.swagger_types = {
'simulation_steps': List[float], 'simulation_times': List[float],
'neuron_ids': List[float] 'neuron_ids': List[float]
} }
self.attribute_map = { self.attribute_map = {
'simulation_steps': 'simulation_steps', 'simulation_times': 'simulation_times',
'neuron_ids': 'neuron_ids' 'neuron_ids': 'neuron_ids'
} }
self._simulation_steps = simulation_steps self._simulation_times = simulation_times
self._neuron_ids = neuron_ids self._neuron_ids = neuron_ids
@classmethod @classmethod
...@@ -48,25 +48,25 @@ class Spikes(Model): ...@@ -48,25 +48,25 @@ class Spikes(Model):
return util.deserialize_model(dikt, cls) return util.deserialize_model(dikt, cls)
@property @property
def simulation_steps(self) -> List[float]: def simulation_times(self) -> List[float]:
"""Gets the simulation_steps of this Spikes. """Gets the simulation_times of this Spikes.
:return: The simulation_steps of this Spikes. :return: The simulation_times of this Spikes.
:rtype: List[float] :rtype: List[float]
""" """
return self._simulation_steps return self._simulation_times
@simulation_steps.setter @simulation_times.setter
def simulation_steps(self, simulation_steps: List[float]): def simulation_times(self, simulation_times: List[float]):
"""Sets the simulation_steps of this Spikes. """Sets the simulation_times of this Spikes.
:param simulation_steps: The simulation_steps of this Spikes. :param simulation_times: The simulation_times of this Spikes.
:type simulation_steps: List[float] :type simulation_times: List[float]
""" """
self._simulation_steps = simulation_steps self._simulation_times = simulation_times
@property @property
def neuron_ids(self) -> List[float]: def neuron_ids(self) -> List[float]:
......
...@@ -10,12 +10,12 @@ schemes: ...@@ -10,12 +10,12 @@ schemes:
- "https" - "https"
- "http" - "http"
paths: paths:
/timestep: /info:
get: get:
tags: tags:
- "nest" - "nest"
summary: "Retrieves the time between two simulation steps." summary: "Retrieves general simulation information."
operationId: "get_timestep" operationId: "get_info"
produces: produces:
- "application/json" - "application/json"
parameters: [] parameters: []
...@@ -28,14 +28,14 @@ paths: ...@@ -28,14 +28,14 @@ paths:
400: 400:
description: "Operation failed." description: "Operation failed."
schema: schema:
$ref: "#/definitions/Error" $ref: "#/definitions/Info"
x-swagger-router-controller: "access_node.controllers.nest_controller" x-swagger-router-controller: "access_node.controllers.nest_controller"
/simulation_step_count: /current_simulation_time:
get: get:
tags: tags:
- "nest" - "nest"
summary: "Retrieves the number of simulation steps." summary: "Retrieves the current simulation time."
operationId: "get_simulation_step_count" operationId: "get_current_simulation_time"
produces: produces:
- "application/json" - "application/json"
parameters: [] parameters: []
...@@ -97,28 +97,38 @@ paths: ...@@ -97,28 +97,38 @@ paths:
get: get:
tags: tags:
- "nest" - "nest"
summary: "Retrieves the per-neuron attributes for the given attribute name,\ summary: "Retrieves the per-neuron attributes for the given multimeter name,\
\ simulation steps (optional) and neuron IDs (optional)." \ attribute name, duration (from - to) (optional) and neuron IDs (optional)."
operationId: "get_data" operationId: "get_data"
consumes: consumes:
- "application/json" - "application/json"
produces: produces:
- "application/json" - "application/json"
parameters: parameters:
- name: "multimeter"
in: "query"
description: "Multimeter name."
required: true
type: "string"
- name: "attribute" - name: "attribute"
in: "query" in: "query"
description: "Attribute name." description: "Attribute name."
required: true required: true
type: "string" type: "string"
- name: "simulation_steps" - name: "from"
in: "query" in: "query"
description: "Simulation steps (leave empty for all steps)." description: "First timestep to retreive (leave empty for first step possible)."
required: false required: false
type: "array" type: "number"
items: collectionFormat: "multi"
type: "number" format: "double"
format: "double" - name: "to"
in: "query"
description: "Last timestep to retreive (leave empty for last step possible)."
required: false
type: "number"
collectionFormat: "multi" collectionFormat: "multi"
format: "double"
- name: "neuron_ids" - name: "neuron_ids"
in: "query" in: "query"
description: "Neuron IDs (leave empty for all neurons)." description: "Neuron IDs (leave empty for all neurons)."
...@@ -194,15 +204,27 @@ definitions: ...@@ -194,15 +204,27 @@ definitions:
example: example:
precision: {} precision: {}
name: "name" name: "name"
Data: Multimeter:
type: "object" type: "object"
properties: properties:
first_simulation_step: name:
type: "string"
interval:
type: "number" type: "number"
format: "int64" format: "double"
num_simulation_steps: attribute:
$ref: "#/definitions/Attribute"
measurement_times:
type: "array"
items:
type: "number"
format: "double"
from:
type: "number"
format: "double"
to:
type: "number" type: "number"
format: "int64" format: "double"
neuron_ids: neuron_ids:
type: "array" type: "array"
items: items:
...@@ -215,22 +237,95 @@ definitions: ...@@ -215,22 +237,95 @@ definitions:
items: items:
type: "number" type: "number"
example: example:
first_simulation_step: name: "Multimeter_name"
interval: 0.2
attribute:
name: "voltage"
precission: "double"
timesteps:
- 1.2
- 1.4
from: 1.2
to: 1.4
neuron_ids:
- 1 - 1
num_simulation_steps:
- 2 - 2
values: values:
- - 61.48 - - 61.48
- 45.23 - 45.23
- - 13.46 - - 13.46
- 23.77 - 23.77
neuron_ids: MultimeterInfo:
- 1 type: "object"
- 2 properties:
name:
type: "string"
interval:
type: "number"
format: "double"
attributes:
type: "array"
items:
$ref: "#/definitions/Attribute"
Info:
type: "object"
properties:
simulation_resolution:
type: "number"
format: "double"
multimeters:
type: "array"
items:
$ref: "#/definitions/MultimeterInfo"
Data:
type: "object"
properties:
multimeters:
type: "array"
items:
$ref: "#/definitions/Multimeter"
example:
multimeters:
- name: "Multimeter_name"
interval: 0.2
attribute:
name: "voltage"
precission: "double"
timesteps:
- 1.2
- 1.4
from: 1.2
to: 1.4
neuron_ids:
- 1
- 2
values:
- - 61.48
- 45.23
- - 13.46
- 23.77
- name: "Multimeter_name"
interval: 0.2
attribute:
name: "voltage"
precission: "double"
timesteps:
- 1.2
- 1.4
from: 1.2
to: 1.4
neuron_ids:
- 1
- 2
values:
- - 61.48
- 45.23
- - 13.46
- 23.77
Spikes: Spikes:
type: "object" type: "object"
properties: properties:
simulation_steps: simulation_times:
type: "array" type: "array"
items: items:
type: "number" type: "number"
...@@ -241,12 +336,12 @@ definitions: ...@@ -241,12 +336,12 @@ definitions:
type: "number" type: "number"
format: "int64" format: "int64"
example: example:
simulation_steps: simulation_times:
- 2 - 0.80082819046101150206595775671303272247314453125
- 5 - 0.80082819046101150206595775671303272247314453125
neuron_ids: neuron_ids:
- 1 - 6.02745618307040320615897144307382404804229736328125
- 2 - 6.02745618307040320615897144307382404804229736328125
Error: Error:
type: "object" type: "object"
properties: properties:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment