Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
http://localhost:8182/rest/storage/all

Overview

ServiceDescription
Get All StoragesThis service returns the list of currently existing storages on the CMR.
Get One Storage DetailsThis service returns the details of one existing storage on the CMR.
Create StorageThis service enables the creation of new storage. The service returns the details of newly created storage.
Finalize StorageThis service enables the finalization of existing storage.
Delete StorageThis service enables the deletion of existing storage.
Get Recording StateThis service returns the current recording state.
Start or Schedule RecordingThis service enables that the recording is started or scheduled to be started in the future.
Stop RecordingThis service enables the stop of the recording.

...


1. Get All Storages
Anchor
getAllStorages
getAllStorages

This service returns the list of currently existing storages on the CMR.

Path:/rest/storage
/all
Example URI:/rest/storage
/all
Example output:
Code Block
[
   {
      "id":"648ab3c3-5980-4aa3-96cd-c7d360a3b9e9",
      "name":"NewStorage",
      "diskSize":112,
      "description":null,
      "cmrVersion":"n/a",
      "labelList":[
         {
            "id":0,
            "dateValue":1391605845482,
            "storageLabelType":{
               "id":0,
               "onePerStorage":true,
               "editable":false,
               "valueReusable":false,
               "multiType":false,
               "valueClass":"java.util.Date",
               "groupingEnabled":true
            },
            "value":1391605845482,
            "formatedValue":"Feb 5, 2014"
         }
      ],
      "state":"OPENED",
      "storageRecording":false,
      "storageClosed":false,
      "storageOpened":true,
      "storageFolder":"648ab3c3-5980-4aa3-96cd-c7d360a3b9e9"
   },
   {
      "id":"1383f79c-9a26-440d-a891-8c7956adf1fb",
      "name":"Ivan's",
      "diskSize":108,
      "description":null,
      "cmrVersion":"n/a",
      "labelList":[
         {
            "id":0,
            "dateValue":1391605770264,
            "storageLabelType":{
               "id":0,
               "onePerStorage":true,
               "editable":false,
               "valueReusable":false,
               "multiType":false,
               "valueClass":"java.util.Date",
               "groupingEnabled":true
            },
            "value":1391605770264,
            "formatedValue":"Feb 5, 2014"
         }
      ],
      "state":"OPENED",
      "storageRecording":false,
      "storageClosed":false,
      "storageOpened":true,
      "storageFolder":"1383f79c-9a26-440d-a891-8c7956adf1fb"
   }
]

2. Get One Storage Details
Anchor
getOneStorageDetails
getOneStorageDetails

This service returns the details of one existing storage on the CMR.

Path:/rest/storage/
get
{id}
Parameters:
  1. id (String value, required) - Id of the storage to get.
Example URI:/rest/storage/
get?id=
6d623a4b-e9e4-4fdc-ab3b-c1e89d4c6873
Example output:
Code Block
{
   "id":"d6dd6e91-541e-495f-9d51-b1728865cd9c",
   "name":"Created via REST",
   "diskSize":118,
   "description":null,
   "cmrVersion":"n/a",
   "labelList":[
      {
         "id":0,
         "dateValue":1391607409138,
         "storageLabelType":{
            "id":0,
            "onePerStorage":true,
            "editable":false,
            "valueReusable":false,
            "multiType":false,
            "valueClass":"java.util.Date",
            "groupingEnabled":true
         },
         "value":1391607409138,
         "formatedValue":"Feb 5, 2014"
      }
   ],
   "state":"OPENED",
   "storageRecording":false,
   "storageClosed":false,
   "storageOpened":true,
   "storageFolder":"d6dd6e91-541e-495f-9d51-b1728865cd9c"
}

 

3. Create Storage
Anchor
createStorage
createStorage

This service enables the creation of new storage. The service returns the details of newly created storage.

Path:/rest/storage/{name}/create
Parameters:
  1. name (String value, required) - Name for the new storage.
Example URI:/rest/storage/Created%20via%20REST/create
?name=Created%20via%20REST
Example output:
Code Block
{
   "message":"Storage successfully created.",
   "storage":{
      "id":"d6dd6e91-541e-495f-9d51-b1728865cd9c",
      "name":"Created via REST",
      "diskSize":0,
      "description":null,
      "cmrVersion":"n/a",
      "labelList":[
         {
            "id":0,
            "dateValue":1391607409138,
            "storageLabelType":{
               "id":0,
               "onePerStorage":true,
               "editable":false,
               "valueReusable":false,
               "multiType":false,
               "valueClass":"java.util.Date",
               "groupingEnabled":true
            },
            "value":1391607409138,
            "formatedValue":"Feb 5, 2014"
         }
      ],
      "state":"OPENED",
      "storageRecording":false,
      "storageClosed":false,
      "storageOpened":true,
      "storageFolder":"d6dd6e91-541e-495f-9d51-b1728865cd9c"
   }
}

4. Finalize Storage
Anchor
finalizeStorage
finalizeStorage

This service enables the finalization of existing storage.

Path:/rest/storage/{id}/finalize
Parameters:
  1. id (String value, required) - ID of the storage to be deleted.
Example URI:/rest/storage/
finalize?id=
d6dd6e91-541e-495f-9d51-b1728865cd9c/finalize
Example output:
Code Block
{
   "message":"Storage id d6dd6e91-541e-495f-9d51-b1728865cd9c successfully finalized."
}

5. Delete Storage
Anchor
deleteStorage
deleteStorage

This service enables the deletion of existing storage.

Path:/rest/storage/{id}/delete
Parameters:
  1. id (String value, required) - ID of the storage to be deleted.
Example URI:/rest/storage/
delete?id=
d6dd6e91-541e-495f-9d51-b1728865cd9c/delete
Example output:
Code Block
{
   "message":"Storage id d6dd6e91-541e-495f-9d51-b1728865cd9c successfully deleted."
}

6. Get Recording State
Anchor
getRecordingState
getRecordingState

This service returns the current recording state. Output is in map format containing the current state (ON, OFF or SCHEDULED) as well as additional information based on the current state.

Path:/rest/storage/
recording-
state
Example URI:/rest/storage/
recording-
state
Example output:
Code Block
{
   "recordingStatus":"OFF"
}

7. Start or Schedule Recording
Anchor
startRecording
startRecording

This service enables that the recording is started or scheduled to be started in the future. User are advised to first read Recording page for basic information.

Path:/rest/storage/start
-recording
Parameters:
  1. id (String value, required) - ID of the storage where recording data will be saved.
  2. startDelay (Long value, optional) - number of milliseconds to delay the start of the recording, if not passed recording starts right away
  3. recordingDuration (Long value, optional) - number of milliseconds recording will last, if not passed there is no limit to recording duration
  4. extractInvocations (Boolean value, optional) - boolean defining if the data contained in the invocation sequences should be extracted, if not passed defaults to true
  5. autoFinalize (Boolean value, optional) - boolean defining if the storage should be auto-finalize when recording is stopped, if not passed defaults to true
Example URI:/rest/storage/start
-recording
?id=6d623a4b-e9e4-4fdc-ab3b-c1e89d4c6873&startDelay=60000&extractInvocations=false&autoFinalize=true
Example output:
Code Block
{
   "message":"Recording scheduled.",
   "recordingStorage":{
      "id":"82f184b5-5e04-473f-9917-372b71104238",
      "name":"NewStorage",
      "diskSize":112,
      "description":null,
      "cmrVersion":"n/a",
      "labelList":[
         {
            "id":0,
            "dateValue":1391607347073,
            "storageLabelType":{
               "id":0,
               "onePerStorage":true,
               "editable":false,
               "valueReusable":false,
               "multiType":false,
               "valueClass":"java.util.Date",
               "groupingEnabled":true
            },
            "value":1391607347073,
            "formatedValue":"Feb 5, 2014"
         }
      ],
      "state":"RECORDING",
      "storageRecording":true,
      "storageClosed":false,
      "storageOpened":true,
      "storageFolder":"82f184b5-5e04-473f-9917-372b71104238"
   }
}
Warning

Starting or scheduling the recording must provide the ID of the existing storage that is in writable state (not closed).

Warning

If a parameter value passed can not be correctly converted from String to the correct type, the TypeMismatchException will be thrown:

Code Block
titlehttp://localhost:8182/rest/storage/start-recording/..?autoFinalize=trueasdad
{"error":"Failed to convert value of type 'java.lang.String' to required type 'java.lang.Boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [trueasdad]","exceptionType":"org.springframework.beans.TypeMismatchException"}

...



8. Stop Recording
Anchor
stopRecording
stopRecording

This service enables the stop of the recording.

Path:/rest/storage/stop
-recording
Example URI:/rest/storage/stop
-recording
Example output:
Code Block
{"message":"Recording stopped."}

Exception Handling

If any call to the provided services results in an exception, the JSON output that will be returned will mark call as error providing the additional information on the exception:

...