Repository Server API documentation version v6
http://server:port/activeviam/repository/rest/v6
Introduction
This document describes the REST API of Repository server.
Note: the root URL provided here will depend of the deployment of your application. However, path from /repository remain the same.
/parameters
Provide information and actions related to parameters.
Gets the names of all parameters defined in the repository.
Deletes all parameters defined in the repository.
Entity representing a parameter
Gets a definition of a parameter of said name.
The definition only includes active values. To also get a list of pending values, use /{parameter}/all.
When a time window is defined, it describes all changes that occurred in that period of time.
Deletes a parameter of said name.
get /parameters/{parameter}
Gets a definition of a parameter of said name.
The definition only includes active values. To also get a list of pending values, use /{parameter}/all.
When a time window is defined, it describes all changes that occurred in that period of time.
Path Parameters
- parameter: required (string)
Name of a parameter
 
Query Parameters
- from: (string)
Beginning of the time windows.
The value is expected to be a UNIX timestamp in ms or the value
nowto indicate the current time on server side. - to: (string)
End of the time windows.
The value is expected to be a UNIX timestamp in ms or the value
nowto indicate the current time on server side. 
HTTP status code 200
Body
Type: application/json
Example:
{
  "status": "success",
  "data": {
    "name": "pnl_sum_goal",
    "pointValues": [
      {
        "id": 1,
        "name": "pnl_sum_goal",
        "coordinates": {},
        "value": 10,
        "activation": 1460448330196,
        "pending": false,
        "createdAt": {
          "id": 1,
          "timestamp": 1460448330196
        }
      },
      {
        "id": 2,
        "name": "pnl_sum_goal",
        "coordinates": {
          "Currency": "*"
        },
        "value": -50000,
        "activation": 1460448330196,
        "expiration": 1460547037562,
        "pending": false,
        "createdAt": {
          "id": 1,
          "timestamp": 1460448330196
        }
      },
      ...
    ]
  }
}
HTTP status code 400
When parameters is unknown
Body
Type: application/json
Schema:
{
  "status": "error",
  "error": {
    "errorChain": {
      "description": "Chain of error messages, from the root cause to the top",
      "type": "array",
      "items": { "$ref": "errorLink" },
      "minItems": 1,
      "required": true
    },
    "stackTrace": {
      "description": "Technical stack trace as a string. It generally include line breaks and tabulations for a better display",
      "type": "string",
      "required": true
    }
  },
  "definitions": {
    "errorLink": {
      "type": {
        "description": "Type of an error link",
        "type": "string",
        "required": true
      },
      "message": {
        "description": "Message of a given link",
        "type": "string",
        "required": true
      }
    }
  }
}
Example:
{
  "status" : "error",
  "error" : {
    "errorChain" : [ {
      "type" : "BadArgumentException",
      "message" : "[400] Monitor 6 does not exist"
    } ],
    "stackTrace" : "com.qfs.fwk.services.BadArgumentException: [400] Monitor 6 does not exist\n\tat com.qfs.snl.rs.impl.MonitorRestService.safeGet(MonitorRestService.java:283)\n\tat com.qfs.snl.rs.impl.MonitorRestService.getReport(MonitorRestService.java:260)\n\tat sun.reflect.GeneratedMethodAccessor256.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)\n\tat org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)\n\tat org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)\n\t..."
  }
}
delete /parameters/{parameter}
Deletes a parameter of said name.
Path Parameters
- parameter: required (string)
Name of a parameter
 
Query Parameters
- from: (string)
Beginning of the time windows.
The value is expected to be a UNIX timestamp in ms or the value
nowto indicate the current time on server side. - to: (string)
End of the time windows.
The value is expected to be a UNIX timestamp in ms or the value
nowto indicate the current time on server side. 
Entity representing a all
Gets an exhaustive definition of a parameter of said name.
The definition contains all active values, as well as pending ones.
When a time window is defined, it describes all changes that occured in that period of time.
get /parameters/{parameter}/all
Gets an exhaustive definition of a parameter of said name.
The definition contains all active values, as well as pending ones.
When a time window is defined, it describes all changes that occured in that period of time.
Path Parameters
- parameter: required (string)
Name of a parameter
 
Query Parameters
- from: (string)
Beginning of the time windows.
The value is expected to be a UNIX timestamp in ms or the value
nowto indicate the current time on server side. - to: (string)
End of the time windows.
The value is expected to be a UNIX timestamp in ms or the value
nowto indicate the current time on server side. 
HTTP status code 200
Body
Type: application/json
Example:
{
  "status": "success",
  "data": {
    "name": "another_parameter",
    "pointValues": [
      {
        "id": 1,
        "name": "another_parameter",
        "coordinates": {},
        "value": 10,
        "activation": 1460448330196,
        "pending": false,
        "createdAt": {
          "id": 1,
          "timestamp": 1460448330196
        }
      },
      {
        "id": 1,
        "name": "another_parameter",
        "coordinates": {},
        "value": 50,
        "activation": 1460448330196,
        "expiration": 1460547037562,
        "pending": true,
        "createdAt": {
          "id": 2,
          "timestamp": 1460451752307
        }
      },
      ...
    ]
  }
}
HTTP status code 400
When all is unknown
Body
Type: application/json
Schema:
{
  "status": "error",
  "error": {
    "errorChain": {
      "description": "Chain of error messages, from the root cause to the top",
      "type": "array",
      "items": { "$ref": "errorLink" },
      "minItems": 1,
      "required": true
    },
    "stackTrace": {
      "description": "Technical stack trace as a string. It generally include line breaks and tabulations for a better display",
      "type": "string",
      "required": true
    }
  },
  "definitions": {
    "errorLink": {
      "type": {
        "description": "Type of an error link",
        "type": "string",
        "required": true
      },
      "message": {
        "description": "Message of a given link",
        "type": "string",
        "required": true
      }
    }
  }
}
Example:
{
  "status" : "error",
  "error" : {
    "errorChain" : [ {
      "type" : "BadArgumentException",
      "message" : "[400] Monitor 6 does not exist"
    } ],
    "stackTrace" : "com.qfs.fwk.services.BadArgumentException: [400] Monitor 6 does not exist\n\tat com.qfs.snl.rs.impl.MonitorRestService.safeGet(MonitorRestService.java:283)\n\tat com.qfs.snl.rs.impl.MonitorRestService.getReport(MonitorRestService.java:260)\n\tat sun.reflect.GeneratedMethodAccessor256.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)\n\tat org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)\n\tat org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)\n\t..."
  }
}
Entity representing a effective
Gets an effective definition of a parameter of said name.
The definition contains the exact point value for each coordinates that is active at the time of the query.
When a time window is defined, it describes all changes that occured in that period of time.
get /parameters/{parameter}/effective
Gets an effective definition of a parameter of said name.
The definition contains the exact point value for each coordinates that is active at the time of the query.
When a time window is defined, it describes all changes that occured in that period of time.
Path Parameters
- parameter: required (string)
Name of a parameter
 
Query Parameters
- from: (string)
Beginning of the time windows.
The value is expected to be a UNIX timestamp in ms or the value
nowto indicate the current time on server side. - to: (string)
End of the time windows.
The value is expected to be a UNIX timestamp in ms or the value
nowto indicate the current time on server side. 
HTTP status code 200
Body
Type: application/json
Example:
{
  "status": "success",
  "data": {
    "name": "pnl_sum_goal",
    "pointValues": [
      {
        "id": 1,
        "name": "pnl_sum_goal",
        "coordinates": {},
        "value": 10,
        "activation": 1460448330196,
        "pending": false,
        "createdAt": {
          "id": 1,
          "timestamp": 1460448330196
        }
      },
      {
        "id": 2,
        "name": "pnl_sum_goal",
        "coordinates": {
          "Currency": "*"
        },
        "value": -50000,
        "activation": 1460448330196,
        "expiration": 1460547037562,
        "pending": false,
        "createdAt": {
          "id": 1,
          "timestamp": 1460448330196
        }
      },
      ...
    ]
  }
}
HTTP status code 400
When effective is unknown
Body
Type: application/json
Schema:
{
  "status": "error",
  "error": {
    "errorChain": {
      "description": "Chain of error messages, from the root cause to the top",
      "type": "array",
      "items": { "$ref": "errorLink" },
      "minItems": 1,
      "required": true
    },
    "stackTrace": {
      "description": "Technical stack trace as a string. It generally include line breaks and tabulations for a better display",
      "type": "string",
      "required": true
    }
  },
  "definitions": {
    "errorLink": {
      "type": {
        "description": "Type of an error link",
        "type": "string",
        "required": true
      },
      "message": {
        "description": "Message of a given link",
        "type": "string",
        "required": true
      }
    }
  }
}
Example:
{
  "status" : "error",
  "error" : {
    "errorChain" : [ {
      "type" : "BadArgumentException",
      "message" : "[400] Monitor 6 does not exist"
    } ],
    "stackTrace" : "com.qfs.fwk.services.BadArgumentException: [400] Monitor 6 does not exist\n\tat com.qfs.snl.rs.impl.MonitorRestService.safeGet(MonitorRestService.java:283)\n\tat com.qfs.snl.rs.impl.MonitorRestService.getReport(MonitorRestService.java:260)\n\tat sun.reflect.GeneratedMethodAccessor256.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)\n\tat org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)\n\tat org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)\n\t..."
  }
}
Gets all versions for point values defined for a parameter, both active and pending.
get /parameters/{parameter}/history
Gets all versions for point values defined for a parameter, both active and pending.
Path Parameters
- parameter: required (string)
Name of a parameter
 
HTTP status code 200
Body
Type: application/json
Example:
{
  "status": "success",
  "data": [
    {
      "id": 6,
      "name": "lower_goal",
      "coordinates": { "Currency": "*" },
      "value": 110,
      "activation": 1460448330213,
      "pending": false,
      "createdAt": { "id": 2, "timestamp": 1460448330213 },
      "deletedAt": { "id": 6, "timestamp": 1460454969242, "username": "manager2" }
    },
    {
      "id": 8,
      "name": "lower_goal",
      "coordinates": { "Desk": "*" },
      "value": 400,
      "activation": 1460448330213,
      "pending": false,
      "createdAt": { "id": 2, "timestamp": 1460448330213 },
      "deletedAt": { "id": 6, "timestamp": 1460454969242, "username": "manager2" }
    },
    {
      "id": 13,
      "name": "lower_goal",
      "coordinates": { "Desk": "*" },
      "value": 753,
      "expiration": 1464731940000,
      "activation": 1462053600000,
      "pending": true,
      "createdAt": { "id": 5, "timestamp": 1460454964744, "username": "manager2" },
      "deletedAt": { "id": 6, "timestamp": 1460454969242, "username": "manager2" }
    },
    {
      "id": 8,
      "name": "lower_goal",
      "coordinates": { "Desk": "*" },
      "value": 6420,
      "activation": 1460448330213,
      "pending": true,
      "createdAt": { "id": 5, "timestamp": 1460454964744, "username": "manager2" },
      "deletedAt": { "id": 6, "timestamp": 1460454969242, "username": "manager2" }
    },
    {
      "id": 13,
      "name": "lower_goal",
      "coordinates": { "Desk": "*" },
      "value": 753,
      "expiration": 1464731940000,
      "activation": 1462053600000,
      "pending": false,
      "createdAt": { "id": 6, "timestamp": 1460454969242, "username": "manager2" }
    },
    {
      "id": 8,
      "name": "lower_goal",
      "coordinates": { "Desk": "*" },
      "value": 6420,
      "activation": 1460448330213,
      "pending": false,
      "createdAt": { "id": 6, "timestamp": 1460454969242, "username": "manager2" }
    }
  ]
}
Executes a differential change on a parameter.
The change defines point values to be added, deleted or updated.
put /parameters/{parameter}?execute=
Executes a differential change on a parameter.
The change defines point values to be added, deleted or updated.
Path Parameters
- parameter: required (string)
Name of a parameter
 
Body
Type: application/json
Example:
{
  "name": "lower_goal",
  "additions": [{
    "coordinates": {
      "City": "*"
    },
    "value": 620,
    "expiration": 1460756100000
  }],
  "deletions": [{
    "pointValue": 6,
    "audit": 2
  }],
  "updates": [{
    "from": {
      "pointValue": 8,
      "audit": 2
    },
    "to": {
      "id": 8,
      "coordinates": {
        "Desk": "*"
      },
      "value": 240,
      "activation": 1460930400000
    }
  }]
}
HTTP status code 200
Body
Type: application/json
Example:
{
  "status": "success",
  "data": {
    "name": "lower_goal",
    "additions": [
      {
        "id": 14,
        "name": "lower_goal",
        "coordinates": {
          "City": "*"
        },
        "value": 620,
        "pending": false,
        "expiration": 1460756100000,
        "createdAt": {
          "id": 7,
          "timestamp": 1460464604939,
          "username": "admin"
        }
      }
    ],
    "updates": [
      {
        "from": {
          "pointValue": 8,
          "audit": 6
        },
        "to": {
          "id": 8,
          "name": "lower_goal",
          "coordinates": {
            "Desk": "*"
          },
          "value": 240,
          "pending": false,
          "activation": 1460930400000,
          "createdAt": {
            "id": 7,
            "timestamp": 1460464604939,
            "username": "admin"
          }
        }
      }
    ],
    "deletions": [
      {
        "pointValue": 13,
        "audit": 6
      }
    ]
  }
}
Prepares a differential change on a parameter.
The change defines point values to be added, deleted or updated. Unlike /{parameter}?execute, the change is stored and can be edited until the change is either commited or cancelled.
put /parameters/{parameter}?prepare=
Prepares a differential change on a parameter.
The change defines point values to be added, deleted or updated. Unlike /{parameter}?execute, the change is stored and can be edited until the change is either commited or cancelled.
Path Parameters
- parameter: required (string)
Name of a parameter
 
Body
Type: application/json
Example:
{
  "name": "lower_goal",
  "additions": [{
    "coordinates": {
      "City": "*"
    },
    "value": 620,
    "expiration": 1460756100000
  }],
  "deletions": [{
    "pointValue": 6,
    "audit": 2
  }],
  "updates": [{
    "from": {
      "pointValue": 8,
      "audit": 2
    },
    "to": {
      "id": 8,
      "coordinates": {
        "Desk": "*"
      },
      "value": 240,
      "activation": 1460930400000
    }
  }]
}
HTTP status code 200
Body
Type: application/json
Example:
{
  "status": "success",
  "data": {
    "name": "lower_goal",
    "additions": [{
      "pointValue": 15,
      "audit": 8
    }],
    "deletions": [{
      "pointValue": 6,
      "audit": 2
    }],
    "updates": [{
      "from": { "pointValue": 8, "audit": 7 },
      "to": { "pointValue": 8, "audit": 2 }
    }],
    "deletions": []
  }
}
Commits a prepared parameter change.
It is possible to only commit a part of a pending change by only providing its relevant elements.
put /parameters/{parameter}?commit=
Commits a prepared parameter change.
It is possible to only commit a part of a pending change by only providing its relevant elements.
Path Parameters
- parameter: required (string)
Name of a parameter
 
Body
Type: application/json
Example:
{
  "name": "lower_goal",
  "additions": [{
    "pointValue": 15,
    "audit": 8
  }],
  "updates": [{
    "from": {
      "pointValue": 8,
      "audit": 8
    },
    "to": {
      "pointValue": 8,
      "audit": 9
    }
  }],
  "deletions": [{
    "pointValue": 6,
    "audit": 2
  }]
}
HTTP status code 200
Body
Type: application/json
Example:
{
  "name": "lower_goal",
  "additions": [{
    "coordinates": {
      "City": "*"
    },
    "value": 620,
    "expiration": 1460756100000
  }],
  "deletions": [{
    "pointValue": 6,
    "audit": 2
  }],
  "updates": [{
    "from": {
      "pointValue": 8,
      "audit": 2
    },
    "to": {
      "id": 8,
      "coordinates": {
        "Desk": "*"
      },
      "value": 240,
      "activation": 1460930400000
    }
  }]
}
Cancels a prepared parameter change.
It is possible to onyl cancel a part of a pending change by only providing its relevant elements.
put /parameters/{parameter}?cancel=
Cancels a prepared parameter change.
It is possible to onyl cancel a part of a pending change by only providing its relevant elements.
Path Parameters
- parameter: required (string)
Name of a parameter
 
Body
Type: application/json
Example:
{
  "name": "lower_goal",
  "additions": [{
    "pointValue": 15,
    "audit": 8
  }],
  "updates": [{
    "from": {
      "pointValue": 8,
      "audit": 8
    },
    "to": {
      "pointValue": 8,
      "audit": 9
    }
  }],
  "deletions": [{
    "pointValue": 6,
    "audit": 2
  }]
}
Executes in batch a serie of queries to get changes in parameter definitions.
This is the equivalent of /{parameter}?from=xx&to=yy and associated. supporting multiple queries on various parameters in a single call.
The time period can differ depending on the parameter. It is also possible to query updates for a same parameter in different time periods.
post /parameters/?query=
Executes in batch a serie of queries to get changes in parameter definitions.
This is the equivalent of /{parameter}?from=xx&to=yy and associated. supporting multiple queries on various parameters in a single call.
The time period can differ depending on the parameter. It is also possible to query updates for a same parameter in different time periods.
Query Parameters
- all: (string)
Flag to get include changes on pending values in the results
This parameter is incompatible with
effective. The latter has precedence over this. - effective: (string)
Flag to get changes on effective values instead of all values.
This parameter is incompatible with
all. This has precedence over the latter. 
Body
Type: application/json
Example:
[
  {
    "parameter": "lower_goal",
    "period": { "to": "now" }
  }, {
    "parameter": "lower_goal",
    "period": {
      "from": "now",
      "to": "1958057471283"
    }
  }
]
HTTP status code 200
Body
Type: application/json
Example:
{
  "status": "success",
  "data": [
    {
      "addedOrUpdatedPointValues": [
        {
          "id": 13,
          "name": "lower_goal",
          "coordinates": {
            "Desk": "*"
          },
          "value": 753,
          "expiration": 1464731940000,
          "activation": 1462053600000,
          "pending": false,
          "createdAt": {
            "id": 6,
            "timestamp": 1460454969242,
            "username": "manager2"
          }
        }
      ],
      "deletedPointValues": [],
      "updatesTimestamp": 1460463091806
    }, {
      "addedOrUpdatedPointValues": [],
      "deletedPointValues": [
        {
          "id": 8,
          "name": "upper_goal",
          "coordinates": {
            "Desk": "*"
          },
          "value": 6420,
          "activation": 1460448330213,
          "pending": false,
          "createdAt": {
            "id": 6,
            "timestamp": 1460454969242,
            "username": "manager2"
          }
        },
        {
          "id": 7,
          "name": "upper_goal",
          "coordinates": {
            "Currency": "*",
            "Desk": "*"
          },
          "value": 50,
          "activation": 1460448330213,
          "pending": false,
          "createdAt": {
            "id": 2,
            "timestamp": 1460448330213
          },
          "deletedAt": {
            "id": 12,
            "timestamp": 1458055727278
          }
        }
      ],
      "deletedPointValues": [],
      "updatesTimestamp": 1460463091806
    }
  ]
}
Amends multiple pending point values but only for a single parameter.
post /parameters/?amend=
Amends multiple pending point values but only for a single parameter.
Body
Type: application/json
Example:
[{
  "from": {
    "pointValue": 8,
    "audit": 8
  },
  "to": {
    "id": 8,
    "name": "lower_goal",
    "coordinates": {
      "Desk": "*"
    },
    "value": 77531
  }
}]
HTTP status code 200
Body
Type: application/json
Example:
{
  "status": "success",
  "data": [
    {
      "id": 8,
      "name": "lower_goal",
      "coordinates": {
        "Desk": "*"
      },
      "value": 77531,
      "pending": true,
      "createdAt": {
        "id": 9,
        "timestamp": 1460465907349,
        "username": "admin"
      }
    }
  ]
}