Skip to content
Snippets Groups Projects
Commit d46b9ddf authored by Mathis Neumann's avatar Mathis Neumann
Browse files

documentation for all models

parent 8a54f03b
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ import attr from 'ember-data/attr';
/**
* Model for a system which encapsulates all other models
* @class BaseEntity
* @class BaseEntityModel
* @extends DS.Model
* @public
*/
......
......@@ -4,6 +4,7 @@ import attr from 'ember-data/attr';
/**
* represents an abstract communication which groups multiple CommunicationInstances
* @class Communication
* @extends Measurable
*/
const Model = Measurable.extend({
/**
......
import Measurable from './measurable';
import attr from 'ember-data/attr';
/**
* represents a single instance of a `Communication`.
*
* @class CommunicationInstance
* @extends Measurable
*/
const Model = Measurable.extend({
/**
* id of the `Communication` which this is an instance of
*
* @property communicationId
* @type {String}
*/
communicationId: attr('string'),
/**
* id of the sending ServiceInstance
* @property sourceId
* @type String
*/
sourceId: attr('string'),
/**
* id of the receiving ServiceInstance
* @property targetId
* @type String
*/
targetId: attr('string'),
communicationId: attr('string'),
/**
* The amount of workload. Shows how many requests where sent via this connection
* @property workload
* @type Number
*/
workload: attr('number')
});
......
import BaseEntity from './baseentity';
import attr from 'ember-data/attr';
/**
* Model for a system which encapsulates all
* @class MeasurableModel
* @extends BaseEntityModel
* @public
*/
const Model = BaseEntity.extend({
/**
* List of TimeSeries objects
*
* @property timeSeries
* @type {Array|TimeSeries}
*/
timeSeries: attr(),
/**
* Arbitrary list of key value tuples
* @property statusInformations
* @type {Array|StatusInformation}
*/
statusInformations: attr(),
/**
* Status of this entity. `NORMAL`, `WARNING` or `FAIL`
*
* @property status
* @type {String}
* @default NORMAL
*/
status: attr('string') // NORMAL, WARNING, FAIL
});
export default Model;
// FOR DOCUMENTATION ONLY
// jshint unused:false
/**
* An object that does not have an own API endpoint, but is instead only
* accessible because it is nested within other entities
*
* @class NestedMeasurement
*/
const NestedMeasurement = {
/**
* as Ember Data Models each NestedMeasurement also has a unique id,
* but is not an Ember Data Model, since it is not synchronized with any API endpoint
*
* @property id
* @type {String}
*/
id: null,
/**
* id of the entity which contains this object.
* @property parentId
* @type {String}
*/
parentId: null
};
/**
* TimeSeries is a timestamp-bound list of plottable values.
* The values are collected or generated from analytics, monitoring or simulation.
* The list might be appended in the future.
*
* @class TimeSeries
* @extends NestedMeasurement
*/
const TimeSeries = {
/**
* Description for the values
*
* @property label
* @type {String}
*/
label: null,
/**
* Label for the values, e.g. the name of the unit, like `ms` for milliseconds.
* @property valueLabel
* @type {String}
*/
valueLabel: null,
/**
* List of all values
* @type {Array|TimeSeriesElement}
*/
series: null
};
/**
* Representation of one `TimeSeries` value.
*
* @class TimeSeriesElement
* @extends NestedMeasurement
*/
const TimeSeriesElement = {
/**
* the measured/generated value for a specific time
* @property value
* @type {Number}
*/
value: null,
/**
* the time the measurement took place, serialized as a string
* @type {String|Date}
*/
timestamp: null
};
/**
* StatusInformation is a timestamp-bound list of key-value tuples.
* The stored values should represent more or less static information for an entity.
*
* @class StatusInformation
* @extends NestedMeasurement
* @public
*/
const StatusInformation = {
/**
* time of creation
* @property timeStamp
* @type {Date}
*/
timeStamp: null,
/**
* a descriptional key for the data
* @property key
* @type {String}
*/
key: null,
/**
* Arbitrary data stored
* @property value
* @type {String}
*/
value: null,
};
\ No newline at end of file
import Measurable from './measurable';
import attr from 'ember-data/attr';
/**
* A `Node` is a execution environment for `Service`s
* @class NodeModel
* @extends MeasurableModel
*/
const Model = Measurable.extend({
/**
* Label for the the node
*
* @property name
* @type {String}
*/
name: attr('string'),
/**
* IP adress for this node
*
* @property ip
* @type {String}
*/
ip: attr('string'),
/**
* Hostname for this node
*
* @property hostname
* @type {String}
*/
hostname: attr('string'),
/**
* Id of the `NodeGroup` the node is contained in
*
* @property nodeGroupId
* @type {String}
*/
nodeGroupId: attr('string')
});
......
import Measurable from './measurable';
import attr from 'ember-data/attr';
/**
* Arbitrary logical grouping of several nodes.
*
* @class NodeGroupModel
* @extends MeasurableModel
*/
const Model = Measurable.extend({
/**
* Label for this group
*
* @property name
* @type {String}
*/
name: attr('string')
});
......
import Measurable from './measurable';
import attr from 'ember-data/attr';
/**
* A software application fullfilling a function for the system.
*
* @class ServiceModel
* @extends MeasurableModel
*/
const Model = Measurable.extend({
/**
* Label for the service
*
* @property name
* @type {String}
*/
name: attr('string'),
/**
* Description of the function that this service fullfulls
*
* @property description
* @type {String}
*/
description: attr('string')
});
......
import Measurable from './measurable';
import attr from 'ember-data/attr';
/**
* Represenation of a process of a `Service` running on a `Node`.
* @class ServiceInstanceModel
* @extends MeasurableModel
*/
const Model = Measurable.extend({
/**
* Name for the instance (same as from `Service`)
*
* @property name
* @type {String}
*/
name: attr('string'),
/**
* Id of the `Node` the service instance is running on
*
* @property nodeId
* @type {String}
*/
nodeId: attr('string'),
/**
* Id of the `Service` the instance is spawned for
*
* @property serviceId
* @type {String}
*/
serviceId: attr('string')
});
......
......@@ -4,22 +4,20 @@ import { memberAction } from 'ember-api-actions';
/**
* Model for a system which encapsulates all
* @class System
* @extends BaseEntity
* @public
* @class SystemModel
* @extends BaseEntityModel
*/
const Model = BaseEntity.extend({
/**
* name of the system
* @type {String}
* @property name
* @public
*/
name: attr('string'),
/**
* loads the current revision for the system instance from the server (without caching)
* @method getRevision
* @return {Promise|RevisionResponse} plain JS object containing the revisionNumber (number), lastUpdate (Date string), changelogSequence (number)
* @return {Promise|RevisionResponse} the current revision of the system
*/
getRevision: memberAction({ path: 'revision', type: 'GET', urlType: 'findRecord'})
});
......@@ -38,7 +36,6 @@ export default Model;
/**
* Response object from a revision class. This is only for improving the documentation, there is no real class existing.
* @class RevisionResponse
* @public
*/
const Revision = {
// jshint unused:false
......
/**
* Services are singleton instances which are accessible via Embers
* dependency injection mechanism.
*
* @module services
*/
/**
* @modules services
*/
import Ember from 'ember';
/**
* this service stores the global state of the system.
*
* @class SessionService
* @extends {Ember.Service}
* @class SessionService
* @extends Ember.Service
* @public
*/
export default Ember.Service.extend({
......
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